{"record":{"id":"ba727575c8b2dc89","repo":"stablyai/orca","slug":"missing-entrypath-run-pnpm-exec-electron-vite","errorCode":null,"errorMessage":"Missing ${entryPath}; run pnpm exec electron-vite build first","messagePattern":"Missing (.+?); run pnpm exec electron-vite build first","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/hang-watchdog-memory-benchmark.mjs","lineNumber":365,"sourceCode":"      )\n    }\n    const line = result.stdout.split('\\n').find((candidate) => candidate.startsWith(RESULT_PREFIX))\n    if (line) {\n      return { ...JSON.parse(line.slice(RESULT_PREFIX.length)), launchAttempts: attempt }\n    }\n    if (attempt === MAX_LAUNCH_ATTEMPTS || result.stderr || result.stdout) {\n      throw new Error(`Electron trial did not report a result (status ${result.status})`)\n    }\n  }\n  throw new Error('Electron trial exhausted launcher attempts')\n}\n\nfunction runBenchmark() {\n  if (process.platform !== 'darwin') {\n    throw new Error('The production watchdog is macOS-only; run this benchmark on macOS')\n  }\n  if (!existsSync(entryPath)) {\n    throw new Error(`Missing ${entryPath}; run pnpm exec electron-vite build first`)\n  }\n  const options = parseArgs(process.argv.slice(2))\n  const builtEntry = readFileSync(entryPath, 'utf8')\n  const hasChildContract = builtEntry.includes('ORCA_HANG_WATCHDOG_PARENT_PID')\n  const hasWorkerContract = builtEntry.includes('workerData') && builtEntry.includes('parentPort')\n  if (\n    (options.boundary === 'child' && !hasChildContract) ||\n    (options.boundary === 'worker' && !hasWorkerContract)\n  ) {\n    throw new Error(\n      `Built watchdog does not implement the requested ${options.boundary} boundary; rebuild the matching revision`\n    )\n  }\n  const executable = electronPath()\n  const results = Array.from({ length: options.trials }, () =>\n    runTrial(executable, options.boundary)\n  )\n  const rssBytes = results.map((result) => result.rssBytes)","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/hang-watchdog-memory-benchmark.mjs#L347-L383","documentation":"Thrown by runBenchmark() when the built watchdog entry `out/main/main-thread-hang-watchdog-entry.js` does not exist (existsSync returns false). The benchmark forks/spawns this built artifact as the watchdog under test, so it must be produced by the Electron build before the benchmark can run.","triggerScenarios":"Running the benchmark before building, after `clean` wiped out/, on a fresh clone without a build step, or when electron-vite build failed silently.","commonSituations":"Fresh checkout, CI job that skips the build step, or a build configuration change that renamed/moved the output entry.","solutions":["Run `pnpm exec electron-vite build` first to produce out/main/main-thread-hang-watchdog-entry.js.","Verify the path exists: `ls out/main/main-thread-hang-watchdog-entry.js`.","If the build output path changed, update entryPath in the script to match."],"exampleFix":"# before\nnode config/scripts/hang-watchdog-memory-benchmark.mjs --boundary child  # out/ missing\n# after\npnpm exec electron-vite build && node config/scripts/hang-watchdog-memory-benchmark.mjs --boundary child","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs'\nif (!existsSync(entryPath)) {\n  throw new Error(`run 'pnpm exec electron-vite build' first; missing ${entryPath}`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build before benchmarking.","Add the build as a prerequisite step in CI before the benchmark job."],"tags":["benchmark","build-artifact","electron-vite","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}