denoland/deno · error

could not find ' ' .app bundle inside (backend may not ship…

Error message

could not find '{backend}' .app bundle inside {} (backend may not ship as an app for target '{target}')

What it means

Same macOS .app lookup as above but on the downloaded path: ensure_downloaded() verified and extracted the archive, yet locate_app_bundle() finds no .app inside the cache dir. The trailing hint ('backend may not ship as an app for target') reflects the most common cause — the requested backend/target simply packages no .app (that is a Linux/Windows-style archive).

Solutions

  1. Make sure the target you pass is a macOS (darwin) target that the pinned laufey release ships as an .app.
  2. List the cached archive contents (unzip -l) to confirm whether an .app is present at all.
  3. Delete the cache dir and re-run to rule out truncated extraction.
  4. If the release intentionally ships no .app for that backend, choose a backend that does, or update deno so the pin matches a release with the expected layout.

Example fix

# before (macOS)
deno desktop --backend webview2 --target x86_64-pc-windows-msvc
# error: could not find 'webview2' .app bundle inside ~/.cache/... (backend may not ship as an app...)

# after: use a macOS target/backend pair that ships an .app
deno desktop --target aarch64-apple-darwin
Defensive patterns

Strategy: validation

Validate before calling

# Before requesting an .app-based build, confirm the cached archive actually contains one
zip="$HOME/.cache/deno/desktop/laufey/$VER-$TARGET/$BACKEND.zip"
[ -f "$zip" ] && unzip -l "$zip" | grep -q '\.app/$' \
  || echo "no .app in cached archive — pick a darwin target that ships one"

Prevention

When it happens

Trigger: Requesting an .app on macOS for a backend whose pinned archive does not contain one (layout/platform mismatch), or an archive layout change that moved/renamed the .app after a LAUFEY_VERSION bump.

Common situations: Cross-target builds where the target string does not select a darwin archive; a laufey release that stopped shipping .app bundles for a backend; extraction truncated the bundle (disk full).

Related errors


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

Appendix: source

Thrown at cli/tools/desktop.rs:2140

  /// 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).
  async fn find_binary_dir(
    &self,
    backend: &str,
    target: &str,
  ) -> Result<PathBuf, AnyError> {
    let binary = self.find_binary(backend, target).await?;
    let parent = binary.parent().ok_or_else(|| {
      deno_core::anyhow::anyhow!(
        "LAUFEY backend binary has no parent directory: {}",
        binary.display()

View on GitHub (pinned to f7822238ca)