{"record":{"id":"4366b7a65cdb34a2","repo":"stablyai/orca","slug":"skip-build-requested-but-mainpath-does-not-e","errorCode":null,"errorMessage":"--skip-build requested, but ${mainPath} does not exist","messagePattern":"--skip-build requested, but (.+?) does not exist","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-codex-real-account-validation.mjs","lineNumber":346,"sourceCode":"    'node_modules',\n    'electron-vite',\n    'bin',\n    'electron-vite.js'\n  )\n  if (!existsSync(electronViteEntry)) {\n    throw new Error(\n      `Cannot build the validation app: electron-vite entry not found at ${electronViteEntry}. ` +\n        'Install dependencies (pnpm install) or pass --skip-build with a prebuilt out/main/index.js.'\n    )\n  }\n  return { command: process.execPath, args: [electronViteEntry, 'build', '--mode', 'e2e'] }\n}\n\nfunction buildAppIfNeeded(repoRoot, skipBuild) {\n  const mainPath = path.join(repoRoot, 'out', 'main', 'index.js')\n  if (skipBuild) {\n    if (!existsSync(mainPath)) {\n      throw new Error(`--skip-build requested, but ${mainPath} does not exist`)\n    }\n    return mainPath\n  }\n  const { command, args } = resolveElectronViteBuildCommand(repoRoot)\n  execFileSync(command, args, {\n    cwd: repoRoot,\n    stdio: 'inherit',\n    env: { ...process.env, VITE_EXPOSE_STORE: 'true' }\n  })\n  return mainPath\n}\n\nfunction validationCliCommand() {\n  if (process.env.ORCA_VALIDATION_CLI) {\n    return process.env.ORCA_VALIDATION_CLI\n  }\n  if (process.env.ORCA_CLI_COMMAND) {\n    return process.env.ORCA_CLI_COMMAND","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-codex-real-account-validation.mjs#L328-L364","documentation":"Thrown by buildAppIfNeeded in run-codex-real-account-validation.mjs when --skip-build was requested but no prebuilt out/main/index.js exists at the repo root. The skip path is a shortcut that reuses an existing Electron main bundle; without that bundle there is nothing to launch.","triggerScenarios":"Invoking the script with --skip-build in a checkout where electron-vite build has never run (no out/ directory), or after out/ was deleted/cleaned.","commonSituations":"Running validation locally after a git clean, CI where the build step was skipped but no artifact was cached, mismatch between --skip-build expectation and an unbuilt tree.","solutions":["Run the script without --skip-build once to produce out/main/index.js.","Run electron-vite build --mode e2e manually, then re-run with --skip-build.","Restore a previously built out/main/index.js from your artifact cache."],"exampleFix":"// before\nnode config/scripts/run-codex-real-account-validation.mjs --skip-build\n// after\npnpm install && npx electron-vite build --mode e2e\nnode config/scripts/run-codex-real-account-validation.mjs --skip-build","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs'\nimport path from 'node:path'\nconst mainPath = path.join(repoRoot, 'out', 'main', 'index.js')\nif (skipBuild && !existsSync(mainPath)) {\n  throw new Error(`Build first, or drop --skip-build; missing ${mainPath}`)\n}","typeGuard":"function isPrebuiltMain(repoRoot) {\n  return existsSync(path.join(repoRoot, 'out', 'main', 'index.js'))\n}","tryCatchPattern":"try {\n  mainPath = buildAppIfNeeded(repoRoot, options.skipBuild)\n} catch (err) {\n  if (/--skip-build requested/.test(err.message)) {\n    // build the app once, then retry with --skip-build\n  }\n  throw err\n}","preventionTips":["Before passing --skip-build, assert out/main/index.js exists in a preflight check.","Cache the out/ build artifact in CI when using --skip-build.","Document that --skip-build requires a prior successful build."],"tags":["build","electron","validation","cli-flags"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}