denoland/deno · error · Error

Bench attempted to exit with exit code: ${exitCode}

Error message

Bench attempted to exit with exit code: ${exitCode}

What it means

LAUFEY_DEV_DIR is set, so Deno resolves the laufey backend from a local source checkout instead of the download cache — but no built backend binary could be located under that checkout, so resolution aborts before falling back to a download.

Source

Thrown at cli/js/40_bench.js:472

function wrapBenchmark(desc) {
  const fn = desc.fn;
  return async function outerWrapped() {
    let token = null;
    const originalConsole = globalThis.console;
    currentBenchId = desc.id;

    try {
      globalThis.console = new Console((s) => {
        op_dispatch_bench_event({ output: s });
      });

      if (desc.permissions) {
        token = pledgePermissions(desc.permissions);
      }

      if (desc.sanitizeExit) {
        setExitHandler((exitCode) => {
          throw new Error(
            `Bench attempted to exit with exit code: ${exitCode}`,
          );
        });
      }

      const context = createBenchContext(desc);
      const stats = await benchMeasure(
        fn,
        desc,
        context,
      );

      return { ok: stats };
    } catch (error) {
      return { failed: core.destructureError(error) };
    } finally {
      globalThis.console = originalConsole;
      currentBenchId = null;

View on GitHub (pinned to 89f33cbef2)

Solutions

  1. Build the checkout (`cargo build --release` in the laufey repo) and re-run
  2. Verify the expected backend binary exists under the checkout's build output
  3. If dev mode was unintended, unset LAUFEY_DEV_DIR so the cached/fresh download path is used

Example fix

# before
export LAUFEY_DEV_DIR=~/src/laufey   # not built yet
deno desktop --hmr

# after
cargo build --release --manifest-path ~/src/laufey/Cargo.toml
deno desktop --hmr
Defensive patterns

Strategy: validation

Validate before calling

const devDir = Deno.env.get('LAUFEY_DEV_DIR');
if (devDir && !await exists(`${devDir}/target/release/laufey`)) {
  throw new Error('LAUFEY_DEV_DIR set but laufey not built — run cargo build --release first');
}

Prevention

When it happens

Trigger: Setting LAUFEY_DEV_DIR to a laufey source checkout that has not been built (`cargo build --release` not run) or whose build output is in a non-default/absent location.

Common situations: Developers iterating on laufey itself and forgetting to rebuild after pulling; pointing the env var at a stale or partial clone.

Related errors


AI-assisted analysis of denoland/deno@89f33cbef2 (2026-08-16). Data as JSON: /api/errors/45ae5c52b5f5c536. Report an issue: GitHub.