{"record":{"id":"fd856298f3b2c7d6","repo":"denoland/deno","slug":"could-not-find-backend-app-bundle-under-s","errorCode":null,"errorMessage":"could not find '{backend}' .app bundle under {} (set via {})","messagePattern":"could not find '(.+?)' \\.app bundle under (.+?) \\(set via (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":2130,"sourceCode":"\n    let dir = self.ensure_downloaded(backend, target).await?;\n    locate_backend_binary(&dir, backend, target).ok_or_else(|| {\n      deno_core::anyhow::anyhow!(\n        \"could not find '{backend}' backend binary inside {}\",\n        dir.display()\n      )\n    })\n  }\n\n  /// Locate the LAUFEY `.app` bundle for `backend` on a macOS `target`.\n  async fn find_app_bundle(\n    &self,\n    backend: &str,\n    target: &str,\n  ) -> Result<PathBuf, AnyError> {\n    if let Some(dev_dir) = laufey_dev_dir() {\n      return locate_dev_app_bundle(&dev_dir, backend).ok_or_else(|| {\n        deno_core::anyhow::anyhow!(\n          \"could not find '{backend}' .app bundle under {} (set via {})\",\n          dev_dir.display(),\n          LAUFEY_DEV_DIR_ENV\n        )\n      });\n    }\n\n    let dir = self.ensure_downloaded(backend, target).await?;\n    locate_app_bundle(&dir, backend).ok_or_else(|| {\n      deno_core::anyhow::anyhow!(\n        \"could not find '{backend}' .app bundle inside {} (backend may not ship as an app for target '{target}')\",\n        dir.display()\n      )\n    })\n  }\n\n  /// Directory containing the backend binary and its support files (used on\n  /// Windows / Linux where support files sit alongside the binary).","sourceCodeStart":2112,"sourceCodeEnd":2148,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/desktop.rs#L2112-L2148","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Build the .app target in the dev checkout (laufey's macOS app build, not just the bare binary) and re-run.","unset LAUFEY_DEV_DIR to fall back to the downloaded, verified release .app.","Confirm $LAUFEY_DEV_DIR points at the actual laufey checkout root and that a *.app exists under its build output."],"exampleFix":"# before (macOS)\nexport LAUFEY_DEV_DIR=~/src/laufey\ncargo build --release          # builds binary only, no .app\ndeno desktop\n# error: could not find 'wry' .app bundle under /Users/me/src/laufey (set via LAUFEY_DEV_DIR)\n\n# after — build the app target, or leave dev mode\n(cd ~/src/laufey && cargo build --release --bin laufey-app)  # target producing the .app\ndeno desktop","handlingStrategy":"validation","validationCode":"# On macOS dev mode, assert the .app exists before launching\nif [ -n \"$LAUFEY_DEV_DIR\" ] && [ \"$(uname)\" = Darwin ]; then\n  find \"$LAUFEY_DEV_DIR\" -type d -name '*.app' | head -1 >/dev/null \\\n    || { echo \"no .app in LAUFEY_DEV_DIR — build the app target or unset the var\"; exit 1; }\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["On macOS, build the .app-producing target of laufey, not just the bare binary, before enabling LAUFEY_DEV_DIR.","Set the env var per-command rather than globally so stale values cannot shadow the download path.","After cargo clean, remember the dev dir is empty again and will fail both binary and .app lookups."],"tags":["macos","env-var","laufey","app-bundle","development"],"backgroundTag":"invalid-env-var-path","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}