{"record":{"id":"923e198c6984e06b","repo":"stablyai/orca","slug":"missing-entry-path-run-pnpm-run-build-electron","errorCode":null,"errorMessage":"Missing ${ENTRY_PATH}; run pnpm run build:electron-vite first","messagePattern":"Missing (.+?); run pnpm run build:electron-vite first","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/runtime-file-watcher-fault-harness.mjs","lineNumber":65,"sourceCode":"  await build({\n    entryPoints: [SUPERVISOR_SOURCE],\n    bundle: true,\n    platform: 'node',\n    format: 'cjs',\n    outfile,\n    external: ['@parcel/watcher', 'electron'],\n    logLevel: 'silent'\n  })\n  return require(outfile).WatcherProcessSupervisor\n}\n\nasync function main() {\n  if (process.platform === 'win32') {\n    console.log('[runtime-file-watcher-fault] SKIP: SIGSEGV oracle is macOS/Linux only')\n    return\n  }\n  if (!existsSync(ENTRY_PATH)) {\n    throw new Error(`Missing ${ENTRY_PATH}; run pnpm run build:electron-vite first`)\n  }\n\n  // Why: mkdtemp/realpath/bundle/construction can fail before the body runs.\n  // Keep cleanup in finally from the first successful mkdtemp onward, and clean\n  // the original temp path if realpath never succeeds.\n  let createdRootPath\n  let bundleDir\n  let rootPath\n  let supervisor\n  let subscription\n  let watcherCanaryDir\n  let eventListener = () => undefined\n  let rejectWatcherError\n  const watcherError = new Promise((_, reject) => {\n    rejectWatcherError = reject\n  })\n  // Attach early so a callback rejection before the race cannot become unhandled.\n  watcherError.catch(() => undefined)","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/runtime-file-watcher-fault-harness.mjs#L47-L83","documentation":"The fault harness bundles and loads out/main/parcel-watcher-process-entry.js (ENTRY_PATH) to drive the WatcherProcessSupervisor against a real @parcel/watcher child. If the build artifact is absent (the file does not existSync), the harness cannot import the supervisor and aborts, telling the operator to run the build first.","triggerScenarios":"Running runtime-file-watcher-fault-harness.mjs before building the electron main bundle; after `git clean -fdx` wiped out/; in a fresh checkout/CI step that skipped build:electron-vite.","commonSituations":"Fresh clone where the developer ran the fault test without building; CI job reordering that runs the fault harness before the build step; out/ deleted by a clean script.","solutions":["Run pnpm run build:electron-vite first, then the fault harness.","Add build:electron-vite as a prerequisite script dependency of the fault-harness task in package.json.","If the path is wrong (custom out dir), update ENTRY_PATH at runtime-file-watcher-fault-harness.mjs:8 to match."],"exampleFix":"// before\nnode config/scripts/runtime-file-watcher-fault-harness.mjs\n// after\npnpm run build:electron-vite && node config/scripts/runtime-file-watcher-fault-harness.mjs","handlingStrategy":"validation","validationCode":"const { existsSync } = require('node:fs')\nconst ENTRY_PATH = require('path').resolve('out/main/parcel-watcher-process-entry.js')\nif (!existsSync(ENTRY_PATH)) {\n  console.error(`Missing ${ENTRY_PATH}; run pnpm run build:electron-vite first`)\n  process.exit(1)\n}","typeGuard":null,"tryCatchPattern":"try {\n  if (!existsSync(ENTRY_PATH)) throw new Error(`Missing ${ENTRY_PATH}; run pnpm run build:electron-vite first`)\n  // ...harness body...\n} catch (err) {\n  if (/Missing .*build:electron-vite/.test(String(err))) {\n    console.error('Build artifact missing — run pnpm run build:electron-vite and retry.')\n  }\n  throw err\n}","preventionTips":["Make build:electron-vite a prerequisite of the fault-harness package.json task.","Run the harness from a clean build in CI (build then test in the same job).","Add a preflight existsSync check with the friendly message."],"tags":["build","file-watcher","parcel","electron","test-runner"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}