stablyai/orca · error · Error

--skip-build requested, but ${mainPath} does not exist

Error message

--skip-build requested, but ${mainPath} does not exist

What it means

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.

Source

Thrown at config/scripts/run-codex-real-account-validation.mjs:346

    'node_modules',
    'electron-vite',
    'bin',
    'electron-vite.js'
  )
  if (!existsSync(electronViteEntry)) {
    throw new Error(
      `Cannot build the validation app: electron-vite entry not found at ${electronViteEntry}. ` +
        'Install dependencies (pnpm install) or pass --skip-build with a prebuilt out/main/index.js.'
    )
  }
  return { command: process.execPath, args: [electronViteEntry, 'build', '--mode', 'e2e'] }
}

function buildAppIfNeeded(repoRoot, skipBuild) {
  const mainPath = path.join(repoRoot, 'out', 'main', 'index.js')
  if (skipBuild) {
    if (!existsSync(mainPath)) {
      throw new Error(`--skip-build requested, but ${mainPath} does not exist`)
    }
    return mainPath
  }
  const { command, args } = resolveElectronViteBuildCommand(repoRoot)
  execFileSync(command, args, {
    cwd: repoRoot,
    stdio: 'inherit',
    env: { ...process.env, VITE_EXPOSE_STORE: 'true' }
  })
  return mainPath
}

function validationCliCommand() {
  if (process.env.ORCA_VALIDATION_CLI) {
    return process.env.ORCA_VALIDATION_CLI
  }
  if (process.env.ORCA_CLI_COMMAND) {
    return process.env.ORCA_CLI_COMMAND

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Run the script without --skip-build once to produce out/main/index.js.
  2. Run electron-vite build --mode e2e manually, then re-run with --skip-build.
  3. Restore a previously built out/main/index.js from your artifact cache.

Example fix

// before
node config/scripts/run-codex-real-account-validation.mjs --skip-build
// after
pnpm install && npx electron-vite build --mode e2e
node config/scripts/run-codex-real-account-validation.mjs --skip-build
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'node:fs'
import path from 'node:path'
const mainPath = path.join(repoRoot, 'out', 'main', 'index.js')
if (skipBuild && !existsSync(mainPath)) {
  throw new Error(`Build first, or drop --skip-build; missing ${mainPath}`)
}

Type guard

function isPrebuiltMain(repoRoot) {
  return existsSync(path.join(repoRoot, 'out', 'main', 'index.js'))
}

Try / catch

try {
  mainPath = buildAppIfNeeded(repoRoot, options.skipBuild)
} catch (err) {
  if (/--skip-build requested/.test(err.message)) {
    // build the app once, then retry with --skip-build
  }
  throw err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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