{"record":{"id":"606b8a2790cf6166","repo":"denoland/deno","slug":"laufey-backend-exited-with-status","errorCode":null,"errorMessage":"LAUFEY backend exited with status: {}","messagePattern":"LAUFEY backend exited with status: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":1496,"sourceCode":"      .kill_on_drop(true)\n      .spawn()\n      .with_context(|| {\n        format!(\n          \"Failed to launch LAUFEY backend: {}\",\n          laufey_backend.display()\n        )\n      })?;\n    child\n      .wait()\n      .await\n      .context(\"Failed waiting for LAUFEY backend\")?\n  };\n\n  // Keep the mux alive until the subprocess exits, then drop it.\n  drop(mux_handle);\n\n  if !status.success() {\n    bail!(\"LAUFEY backend exited with status: {}\", status);\n  }\n  Ok(())\n}\n\n/// Marker file written into every generated desktop app directory/bundle so a\n/// later build can recognize its own previous output and clear it, while never\n/// touching unrelated user data that happens to share the inferred app name.\nconst APP_DIR_MARKER: &str = \".deno-desktop-app\";\n\n/// Used for `deno desktop --hmr` when a framework runs its own HMR server.\n/// The compiled app has nothing to serve in this case.\nconst NOOP_ENTRYPOINT: &str =\n  \"// @ts-nocheck\\nawait new Promise<void>(() => {});\\n\";\n\n/// Prepare `app_dir` to receive a freshly built bundle.\n///\n/// The app name is inferred from the entrypoint (or, for generic names like\n/// `main.ts`, the project directory), so the output path can collide with an","sourceCodeStart":1478,"sourceCodeEnd":1514,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/desktop.rs#L1478-L1514","documentation":"Thrown after the spawned LAUFEY backend process (the CEF-based webview host that `deno desktop` runs your app in) terminates with a non-zero exit status. The message includes the process status (exit code or signal). Everything before it — the runtime dylib path, LAUFEY_APP_ICON/NAME env, DENO_DESKTOP_HMR wiring — was set up; the failure is in the GUI backend process itself, not in your JS code.","triggerScenarios":"Missing or incompatible LAUFEY runtime payload (corrupted or partial download in the cache); running headless (no DISPLAY on Linux X11, no WAYLAND_DISPLAY) or over plain SSH; CEF sandbox/GPU crash on the host; macOS Gatekeeper quarantining the downloaded backend binary; the runtime dylib path passed via --runtime failing to load.","commonSituations":"First run on a locked-down CI box or container with no display server; corporate proxy truncating the GitHub release download so the backend binary is incomplete; macOS secu quarantining unsigned binaries from the internet; outdated cached laufey payload after a Deno upgrade.","solutions":["Note the status text: an exit code like 127/1 usually means a missing library or denied execution, a signal like SIGSEGV means a CEF crash — search the LAUFEY/Deno issue trackers for that exact status.","Re-run with `DENO_LOG=debug` to get backend stderr detail.","Ensure a display is available (run on the desktop session; for CI use xvfb) and on macOS allow the binary in System Settings → Privacy & Security if Gatekeeper blocked it.","Clear the LAUFEY cache directory and rebuild so the backend archive is re-downloaded and checksum-verified fresh."],"exampleFix":"# before\nssh build-server   # then: deno desktop main.ts  -> backend exits, no display\n\n# after (local desktop session, or headless CI with a virtual display)\nxvfb-run deno desktop main.ts","handlingStrategy":"try-catch","validationCode":"# bash: fail fast in headless environments before launching the GUI backend\nif [[ -z \"${DISPLAY:-}\" && -z \"${WAYLAND_DISPLAY:-}\" && \"$OSTYPE\" != darwin* && \"$OSTYPE\" != msys ]]; then\n  echo \"no display server available for deno desktop\" >&2; exit 1\nfi\ndeno desktop main.ts","typeGuard":null,"tryCatchPattern":"# Capture the status text from the error and route it\nset +e\nOUT=\"$(DENO_LOG=debug deno desktop main.ts 2>&1)\"; RC=$?\nset -e\nif grep -q \"LAUFEY backend exited with status\" <<<\"$OUT\"; then\n  echo \"backend crash — check the status code above, display env, and laufey cache\" >&2\nfi\nexit $RC","preventionTips":["Run desktop builds in a real desktop session; use xvfb-run for CI.","Keep the LAUFEY cache on a disk with space; clear it after Deno upgrades.","On macOS, approve Gatekeeper prompts for the backend binary once after first download.","Save the exit status when it fails — it is the key datum for issue searches."],"tags":["desktop","laufey","subprocess","webview","cef"],"backgroundTag":"subprocess-nonzero-exit","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-31T04:17:50.494Z"}