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-idle-cpu-benchmark.mjs when --skip-build is set but out/main/index.js does not exist. The benchmark's skip path reuses a prebuilt Electron main bundle; if it is absent, there is nothing to measure against.

Source

Thrown at config/scripts/run-idle-cpu-benchmark.mjs:159

  }
  return options
}
function printUsage() {
  console.log(
    `Usage: node config/scripts/run-idle-cpu-benchmark.mjs [options]\n\nOptions:\n  --warmup-ms <n>    Time to wait after app readiness before sampling (default ${DEFAULT_WARMUP_MS})\n  --sample-ms <n>    Sampling window duration (default ${DEFAULT_SAMPLE_MS})\n  --interval-ms <n>  Sampling cadence (default ${DEFAULT_INTERVAL_MS})\n  --worktrees <n>    Seed repo worktree count, including primary (default ${DEFAULT_WORKTREE_COUNT})\n  --lineage-depth <n>  Nest all worktrees under one expanded lineage, up to this depth\n  --agents-per-worktree <n>  Seed this many visible inline agent rows per worktree\n  --zustand-publications <n>  Publish exactly this many store updates during sampling\n  --zustand-publication-interval-ms <n>  Publication cadence (default ${DEFAULT_ZUSTAND_PUBLICATION_INTERVAL_MS})\n  --headful          Show the Electron window while measuring\n  --skip-build       Reuse out/main/index.js instead of building first\n  --output <path>    Write JSON report to this path\n  --disable-renderer-animations  Inject measurement-only CSS that disables animations/transitions\n  --synthetic-visible-spinners <n>  Measurement-only: add visible working spinners\n  --synthetic-spinner-animation <smooth|steps>  Spinner animation style (default smooth)\n  --synthetic-spinner-steps <n>  Step count for --synthetic-spinner-animation steps (default 12)\n`
  )
}
function run(command, args, options = {}) {
  execFileSync(command, args, { stdio: options.stdio ?? 'pipe', encoding: 'utf8', ...options })
}

function buildAppIfNeeded(root, skipBuild) {
  const mainPath = path.join(root, 'out', 'main', 'index.js')
  if (skipBuild && existsSync(mainPath)) {
    return mainPath
  }
  if (skipBuild) {
    throw new Error(`--skip-build requested, but ${mainPath} does not exist`)
  }
  console.log('[idle-cpu] building Electron app with electron-vite --mode e2e')
  run('npx', ['electron-vite', 'build', '--mode', 'e2e'], {
    cwd: root,
    stdio: 'inherit',
    env: { ...process.env, VITE_EXPOSE_STORE: 'true' }
  })
  return mainPath
}

function makeCompletedOnboardingProfile() {
  return {
    settings: {
      telemetry: {
        optedIn: true,
        installId: '00000000-0000-4000-8000-000000000000',
        existedBeforeTelemetryRelease: false
      }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Drop --skip-build for the first run to build out/main/index.js.
  2. Run npx electron-vite build --mode e2e (with VITE_EXPOSE_STORE=true) then reuse --skip-build.
  3. Restore out/main/index.js from your build cache.

Example fix

# before
node config/scripts/run-idle-cpu-benchmark.mjs --skip-build
# after
VITE_EXPOSE_STORE=true npx electron-vite build --mode e2e
node config/scripts/run-idle-cpu-benchmark.mjs --skip-build
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

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

Try / catch

try {
  mainPath = buildAppIfNeeded(root, options.skipBuild)
} catch (err) {
  if (/--skip-build requested/.test(err.message)) {
    // drop --skip-build and let it build, or restore the artifact
  }
  throw err
}

Prevention

When it happens

Trigger: Running the benchmark with --skip-build in a tree where electron-vite build --mode e2e has never produced out/main/index.js, or after out/ was removed.

Common situations: Local run after git clean, CI skipping build without caching the artifact, switching branches that don't share the build output.

Related errors


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