{"record":{"id":"7d0fae28d6ceca60","repo":"denoland/deno","slug":"could-not-find-backend-backend-binary-under","errorCode":null,"errorMessage":"could not find '{backend}' backend binary under {} (set via {})","messagePattern":"could not find '(.+?)' backend binary under (.+?) \\(set via (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":2090,"sourceCode":"      );\n    }\n\n    Ok(dir)\n  }\n\n  /// Locate the LAUFEY backend binary for `backend` on `target`.\n  ///\n  /// Resolution order: `LAUFEY_DEV_DIR` checkout → cached download →\n  /// fresh download.\n  async fn find_binary(\n    &self,\n    backend: &str,\n    target: &str,\n  ) -> Result<PathBuf, AnyError> {\n    if let Some(dev_dir) = laufey_dev_dir() {\n      let binary =\n        locate_dev_backend_binary(&dev_dir, backend).ok_or_else(|| {\n          deno_core::anyhow::anyhow!(\n            \"could not find '{backend}' backend binary under {} (set via {})\",\n            dev_dir.display(),\n            LAUFEY_DEV_DIR_ENV\n          )\n        })?;\n      // Re-sign the dev laufey build so its identifier matches the bundle\n      // id — same fix as the download path, applied every launch\n      // because a fresh `cargo build` of laufey restores the linker's\n      // default `Identifier=laufey`. The harmonize call is idempotent:\n      // already-correct binaries are skipped.\n      #[cfg(target_os = \"macos\")]\n      if let Some(laufey_app) = laufey_app_for_binary(&binary)\n        && let Err(e) = harmonize_laufey_app_identifiers(&laufey_app)\n      {\n        log::warn!(\n          \"[desktop] could not re-sign dev laufey backend: {e} \\\n           (notifications may not work in HMR mode)\"\n        );","sourceCodeStart":2072,"sourceCodeEnd":2108,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/desktop.rs#L2072-L2108","documentation":"When the LAUFEY_DEV_DIR environment variable is set, `deno desktop` uses that laufey source checkout instead of downloading a release, resolving the backend binary with locate_dev_backend_binary(). This error means the env var pointed at a directory that contains no buildable/located binary for the requested backend — typically a checkout that has not been cargo-built yet.","triggerScenarios":"LAUFEY_DEV_DIR is exported (e.g. to hack on laufey) but the checkout has never been built, was cleaned with cargo clean, or was built only for a different backend than the one requested on the command line.","commonSituations":"A developer exports LAUFEY_DEV_DIR in their shell profile, then clones a fresh laufey checkout and forgets `cargo build`; CI caches a dev dir but the build step was skipped; the env var survived from an old experiment and now shadows the working download path.","solutions":["Build the backend in the dev checkout: run laufey's own build (e.g. cargo build --release) inside $LAUFEY_DEV_DIR so the expected binary layout exists.","If you did not intend dev mode, unset LAUFEY_DEV_DIR and re-run to fall back to the cached/download path.","Verify the path actually points at a laufey checkout (look for its Cargo.toml and build output dirs) and fix the env var.","Request the same backend you built for in the dev checkout."],"exampleFix":"# before\nexport LAUFEY_DEV_DIR=~/src/laufey   # fresh clone, never built\ndeno desktop\n# error: could not find 'wry' backend binary under /home/me/src/laufey (set via LAUFEY_DEV_DIR)\n\n# after — option A: build it\n(cd ~/src/laufey && cargo build --release) && deno desktop\n# after — option B: leave dev mode\nunset LAUFEY_DEV_DIR && deno desktop","handlingStrategy":"validation","validationCode":"# If LAUFEY_DEV_DIR is set, assert the checkout actually contains the backend build\nif [ -n \"$LAUFEY_DEV_DIR\" ]; then\n  find \"$LAUFEY_DEV_DIR\" -type f -name '*laufey*' -perm -u+x | head -1 >/dev/null \\\n    || { echo \"LAUFEY_DEV_DIR set but no built backend found — run cargo build or unset it\"; exit 1; }\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scope LAUFEY_DEV_DIR to the specific command that needs it (LAUFEY_DEV_DIR=... deno desktop) instead of exporting it in your shell profile.","Re-run the laufey build (cargo build) after pulling or cargo clean-ing the dev checkout.","Remember the env var shadows the verified download path entirely — if you did not mean dev mode, unset it."],"tags":["env-var","development","laufey","build","desktop"],"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"}