denoland/deno · error

could not find ' ' .app bundle under (set via )

Error message

could not find '{backend}' .app bundle under {} (set via {})

What it means

On macOS, `deno desktop` needs the backend as an .app bundle. When LAUFEY_DEV_DIR is set it looks for the built .app inside the dev checkout (locate_dev_app_bundle) and this error means none was found there — the macOS app target of the laufey checkout has not been built, or was cleaned.

Solutions

  1. Build the .app target in the dev checkout (laufey's macOS app build, not just the bare binary) and re-run.
  2. unset LAUFEY_DEV_DIR to fall back to the downloaded, verified release .app.
  3. Confirm $LAUFEY_DEV_DIR points at the actual laufey checkout root and that a *.app exists under its build output.

Example fix

# before (macOS)
export LAUFEY_DEV_DIR=~/src/laufey
cargo build --release          # builds binary only, no .app
deno desktop
# error: could not find 'wry' .app bundle under /Users/me/src/laufey (set via LAUFEY_DEV_DIR)

# after — build the app target, or leave dev mode
(cd ~/src/laufey && cargo build --release --bin laufey-app)  # target producing the .app
deno desktop
Defensive patterns

Strategy: validation

Validate before calling

# On macOS dev mode, assert the .app exists before launching
if [ -n "$LAUFEY_DEV_DIR" ] && [ "$(uname)" = Darwin ]; then
  find "$LAUFEY_DEV_DIR" -type d -name '*.app' | head -1 >/dev/null \
    || { echo "no .app in LAUFEY_DEV_DIR — build the app target or unset the var"; exit 1; }
fi

Prevention

When it happens

Trigger: LAUFEY_DEV_DIR exported on macOS plus a checkout where the .app-producing target was never built (only the plain binary target was), or the env var points at a stale/wrong directory.

Common situations: Developer builds laufey with plain `cargo build` (CLI binary only, no .app) then runs `deno desktop` on macOS in dev mode; cargo clean removed the app bundle; env var left over from a deleted checkout.

Related errors


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

Appendix: source

Thrown at cli/tools/desktop.rs:2130

    let dir = self.ensure_downloaded(backend, target).await?;
    locate_backend_binary(&dir, backend, target).ok_or_else(|| {
      deno_core::anyhow::anyhow!(
        "could not find '{backend}' backend binary inside {}",
        dir.display()
      )
    })
  }

  /// Locate the LAUFEY `.app` bundle for `backend` on a macOS `target`.
  async fn find_app_bundle(
    &self,
    backend: &str,
    target: &str,
  ) -> Result<PathBuf, AnyError> {
    if let Some(dev_dir) = laufey_dev_dir() {
      return locate_dev_app_bundle(&dev_dir, backend).ok_or_else(|| {
        deno_core::anyhow::anyhow!(
          "could not find '{backend}' .app bundle under {} (set via {})",
          dev_dir.display(),
          LAUFEY_DEV_DIR_ENV
        )
      });
    }

    let dir = self.ensure_downloaded(backend, target).await?;
    locate_app_bundle(&dir, backend).ok_or_else(|| {
      deno_core::anyhow::anyhow!(
        "could not find '{backend}' .app bundle inside {} (backend may not ship as an app for target '{target}')",
        dir.display()
      )
    })
  }

  /// Directory containing the backend binary and its support files (used on
  /// Windows / Linux where support files sit alongside the binary).

View on GitHub (pinned to f7822238ca)