stablyai/orca · error

bin.orca target is empty: ${binTarget}

Error message

bin.orca target is empty: ${binTarget}

What it means

The bin target exists and is a regular file but has zero bytes — a build that emitted an empty placeholder, a truncated write, or a stub. An empty executable would either fail with an exec format error or, worse, be skipped silently by some launchers, so the gate rejects it explicitly. The interpolated binTarget names the offending path.

Source

Thrown at config/scripts/verify-cli-bin.mjs:41

  projectDir = path.resolve(import.meta.dirname, '..', '..'),
  fixExecutable = false,
  fixPackageJson = false,
  runHelp = false
} = {}) {
  const packageJsonPath = path.join(projectDir, 'package.json')
  const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'))
  const binTarget = packageJson.bin?.orca
  if (typeof binTarget !== 'string' || binTarget.length === 0) {
    throw new Error('package.json must declare bin.orca')
  }

  const binPath = path.resolve(projectDir, binTarget)
  const stats = statSync(binPath)
  if (!stats.isFile()) {
    throw new Error(`bin.orca target is not a file: ${binTarget}`)
  }
  if (stats.size === 0) {
    throw new Error(`bin.orca target is empty: ${binTarget}`)
  }

  const content = readFileSync(binPath, 'utf8')
  if (!content.startsWith('#!/usr/bin/env node\n')) {
    throw new Error(`bin.orca target must start with a Node shebang: ${binTarget}`)
  }

  const outPackageJsonPath = path.join(projectDir, 'out', 'package.json')
  if (fixPackageJson) {
    mkdirSync(path.dirname(outPackageJsonPath), { recursive: true })
    writeFileSync(outPackageJsonPath, OUT_COMMONJS_PACKAGE_JSON, 'utf8')
  }
  let outPackageJson
  try {
    outPackageJson = JSON.parse(readFileSync(outPackageJsonPath, 'utf8'))
  } catch (error) {
    if (error && typeof error === 'object' && 'code' in error && error.code === 'ENOENT') {
      throw new Error(

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Rebuild the CLI bundle (`pnpm run build:electron-vite` or the dedicated CLI build) and confirm the entry is non-empty.
  2. Delete the empty file and rebuild to rule out a stale-touch race.
  3. If the build genuinely produces an empty file, fix the bundler entry/config before re-running verify-cli-bin.
Defensive patterns

Strategy: validation

Validate before calling

const st = statSync(binPath)
if (st.size === 0) throw new Error(`refusing to verify empty bin target: ${binPath}`)

Prevention

When it happens

Trigger: statSync(binPath).size === 0 at line 40. Caused by a build step that created the file but wrote nothing (failed transpilation that still touched the path), a `touch` placeholder, or a partial write interrupted mid-build.

Common situations: A broken bundler config that opens the output file but errors before writing content; a watch-mode race where the file is stat'd during a rebuild; a corrupted checkout after an interrupted build.

Related errors


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