denoland/deno · error

app bundle has no name

Error message

app bundle has no name

What it means

While building a macOS DMG, the code copies the .app into a staging dir using its final path component (staging.path().join(app_bundle.file_name())). file_name() is None only for root/'..'-terminated paths, so this error means the app-bundle path handed to the DMG builder had no name component to stage it under.

Solutions

  1. Re-run with a normal --output file path so the derived app bundle path is well-formed.
  2. If it reproduces, note the exact command and bundle path and report it as a deno bug.
Defensive patterns

Strategy: validation

Validate before calling

// The DMG builder should always receive a named bundle; assert it at the call site
let name = app_bundle.file_name().expect("bundle path must have a file name");
// or defensively:
if app_bundle.file_name().is_none() { return anyhow::bail!("invalid app bundle path: {}", app_bundle.display()); }

Prevention

When it happens

Trigger: app_bundle resolves to '/' or a path ending in '..' when the DMG staging copy is computed — degenerate input into build_dmg, since the bundle normally comes from the bundler's own output directory (e.g. <parent>/<app_name>.app derived from a validated --output).

Common situations: Not reachable through normal CLI usage; would require an internal caller passing a sanitized-to-root bundle path. Think of it as an invariant guard converted from an unwrap().

Related errors


AI-assisted analysis of denoland/deno@f7822238ca (2026-08-20). Data as JSON: /api/errors/4e783fd14ec949ca. Report an issue: GitHub.

Appendix: source

Thrown at cli/tools/desktop.rs:3494

  // pre-creating it as a symlink), and cleans up on drop.
  let parent = dmg_path
    .parent()
    .filter(|p| !p.as_os_str().is_empty())
    .unwrap_or_else(|| Path::new("."));
  std::fs::create_dir_all(parent)?;
  let staging = tempfile::Builder::new()
    .prefix(".dmg-staging-")
    .tempdir_in(parent)
    .with_context(|| {
      format!("failed to stage DMG tempdir in {}", parent.display())
    })?;

  // Copy the .app into the staging dir and add an /Applications symlink so
  // users can drag the app across in the mounted DMG window.
  let staged_app = staging.path().join(
    app_bundle
      .file_name()
      .ok_or_else(|| deno_core::anyhow::anyhow!("app bundle has no name"))?,
  );
  crate::tools::compile::copy_dir_all(app_bundle, &staged_app)?;
  #[cfg(unix)]
  {
    let _ = std::os::unix::fs::symlink(
      "/Applications",
      staging.path().join("Applications"),
    );
  }

  if dmg_path.exists() {
    std::fs::remove_file(dmg_path)?;
  }

  let status = std::process::Command::new("hdiutil")
    .args([
      "create",
      "-volname",

View on GitHub (pinned to f7822238ca)