stablyai/orca · critical

[verify-packaged-daemon-entry] missing unpacked daemon entry

Error message

[verify-packaged-daemon-entry] missing unpacked daemon entry at ${entryPath} — asarUnpack expects out/main/daemon-entry.js on every platform, so the packaged daemon cannot be forked from this layout

What it means

Thrown by the packaged daemon entry verification script when the file app.asar.unpacked/out/main/daemon-entry.js does not exist inside the packaged Resources directory. The script checks this path because electron-builder's asarUnpack config lists out/main/daemon-entry.js on every platform, and the runtime daemon fork (src/main/daemon/daemon-init.ts) resolves exactly this unpacked path. A missing file means the packaged layout regressed and the daemon cannot be forked at runtime.

Source

Thrown at config/scripts/verify-packaged-daemon-entry.cjs:14

const { existsSync } = require('node:fs')
const { spawnSync } = require('node:child_process')
const { join } = require('node:path')

// Why: `asarUnpack` in config/electron-builder.config.cjs lists
// out/main/daemon-entry.js on every platform, and the packaged daemon fork
// (src/main/daemon/daemon-init.ts) resolves exactly this unpacked path. A
// missing entry means the package layout regressed, so the check throws
// instead of skipping — a silent skip false-passed exactly the layout bug
// this gate exists to catch.
function assertPackagedDaemonEntryExists(resourcesDir) {
  const entryPath = join(resourcesDir, 'app.asar.unpacked', 'out', 'main', 'daemon-entry.js')
  if (!existsSync(entryPath)) {
    throw new Error(
      `[verify-packaged-daemon-entry] missing unpacked daemon entry at ${entryPath} — ` +
        `asarUnpack expects out/main/daemon-entry.js on every platform, so the packaged ` +
        `daemon cannot be forked from this layout`
    )
  }
  return entryPath
}

// Why: v1.4.129-rc.1 shipped a terminal daemon that could not load (an electron
// `require` leaked into its bundle) while every build check passed. This boots
// the PACKAGED daemon-entry under plain Node against the asar-unpacked layout,
// so a bundling / asar-unpack regression fails packaging instead of reaching
// users. Module-load proof only: with no args the entry must reach argv parsing
// and print its "Usage: daemon-entry" error — a MODULE_NOT_FOUND or a missing
// usage line means the packaged graph does not load and the build must fail.
//
// resourcesDir is the packaged Resources dir (Contents/Resources on macOS,
// <appOutDir>/resources elsewhere). execPath defaults to the packaging Node.

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Check that out/main/daemon-entry.js exists in the build output: ls out/main/daemon-entry.js
  2. Verify the asarUnpack array in config/electron-builder.config.cjs still includes 'out/main/daemon-entry.js'.
  3. Rebuild the project to regenerate the daemon entry bundle, then re-package.
  4. If the daemon entry file was intentionally renamed, update both the asarUnpack glob and the daemon-init.ts resolver path to match.
Defensive patterns

Strategy: validation

Validate before calling

// Before calling verifyPackagedDaemonEntryExists, check the build output exists.
const { existsSync } = require('node:fs')
const { join } = require('node:path')

function preCheckDaemonEntry(buildOutDir) {
  const entrySrc = join(buildOutDir, 'main', 'daemon-entry.js')
  if (!existsSync(entrySrc)) {
    return {
      ok: false,
      message: `daemon-entry.js not found at ${entrySrc} — rebuild the project before packaging.`
    }
  }
  return { ok: true }
}

Prevention

When it happens

Trigger: Running verifyPackagedDaemonEntryExists(resourcesDir) against a packaged app where the build output at out/main/daemon-entry.js was not produced, or the asarUnpack glob in electron-builder.config.cjs was changed and no longer matches it. Can also occur if the build step that generates daemon-entry.js (esbuild/webpack bundling) was skipped or failed silently.

Common situations: A refactor renamed daemon-entry.js to something else but the asarUnpack config was not updated; the bundling step for the daemon entry was removed from the build pipeline; the file exists in the source tree but the build didn't emit it to out/main/; running the verification against a partially-built or stale package output directory.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/5045351f8d564206. Report an issue: GitHub.