stablyai/orca · error · Error

Usage: node config/scripts/release-rc-history.mjs <base-vers

Error message

Usage: node config/scripts/release-rc-history.mjs <base-version>

What it means

Thrown by main() in config/scripts/release-rc-history.mjs when the script is invoked without a base-version argument. The script computes the highest existing RC number for a given base (e.g. for `1.2.3` it scans `v1.2.3-rc.*` tags and release-commit subjects) and writes it to stdout; with no base there is nothing to scan. main() reads `process.argv[2]` and throws at line 77-78 if it is falsy.

Source

Thrown at config/scripts/release-rc-history.mjs:78

  const logRefs = ['HEAD', 'origin/main'].filter(
    (ref) => gitLines(['rev-parse', '--verify', '--quiet', ref], cwd).length > 0
  )
  if (logRefs.length > 0) {
    for (const subject of gitLines(['log', '--format=%s', ...logRefs], cwd)) {
      const rcNumber = rcNumberFromReleaseSubject(base, subject)
      if (rcNumber !== null) {
        numbers.push(rcNumber)
      }
    }
  }

  return numbers.length === 0 ? null : Math.max(...numbers)
}

function main() {
  const base = process.argv[2]
  if (!base) {
    throw new Error('Usage: node config/scripts/release-rc-history.mjs <base-version>')
  }

  const highest = highestRcForBase(base)
  if (highest !== null) {
    process.stdout.write(String(highest))
  }
}

if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
  try {
    main()
  } catch (error) {
    console.error(error instanceof Error ? error.message : String(error))
    process.exit(1)
  }
}

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Pass the base version as the first positional arg, e.g. `node config/scripts/release-rc-history.mjs 1.2.3`.
  2. In CI, ensure the BASE_VERSION (or equivalent) variable is set and forwarded: `... "${BASE_VERSION}"`.
  3. Confirm your wrapper does not swallow argv when delegating to the script.

Example fix

// before
node config/scripts/release-rc-history.mjs

// after
node config/scripts/release-rc-history.mjs 1.2.3
Defensive patterns

Strategy: validation

Validate before calling

const base = process.argv[2]
if (!base || !/^\d+\.\d+\.\d+$/.test(base)) {
  throw new Error('Usage: node config/scripts/release-rc-history.mjs <base-version> (e.g. 1.2.3)')
}

Type guard

function isBaseVersion(value) {
  return typeof value === 'string' && /^\d+\.\d+\.\d+$/.test(value)
}

Prevention

When it happens

Trigger: Run `node config/scripts/release-rc-history.mjs` with no positional argument, or invoke it via a wrapper that drops argv[2]. The guard fires before highestRcForBase is called.

Common situations: A release workflow step forwards an unset `BASE_VERSION` variable to the script (so argv[2] is undefined), or a developer runs the script manually to inspect RC history without reading its usage. The message doubles as the usage string.

Related errors


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