{"record":{"id":"073c13f94d67c200","repo":"stablyai/orca","slug":"missing-value-for-arg","errorCode":null,"errorMessage":"Missing value for ${arg}","messagePattern":"Missing value for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/hang-watchdog-memory-benchmark.mjs","lineNumber":287,"sourceCode":"          ? await measureWorker(markerPath)\n          : (() => {\n              throw new Error(`Unsupported boundary: ${boundary}`)\n            })()\n    process.stdout.write(`${RESULT_PREFIX}${JSON.stringify(result)}\\n`)\n  } finally {\n    app.quit()\n    rmSync(profileDir, { recursive: true, force: true })\n  }\n}\n\nfunction parseArgs(argv) {\n  const options = { boundary: '', trials: DEFAULT_TRIALS, output: '' }\n  for (let index = 0; index < argv.length; index += 1) {\n    const arg = argv[index]\n    const value = argv[index + 1]\n    if (arg === '--boundary' || arg === '--trials' || arg === '--output') {\n      if (!value) {\n        throw new Error(`Missing value for ${arg}`)\n      }\n      options[arg.slice(2)] = arg === '--trials' ? Number(value) : value\n      index += 1\n    } else {\n      throw new Error(`Unknown argument: ${arg}`)\n    }\n  }\n  if (!['child', 'worker'].includes(options.boundary)) {\n    throw new Error('--boundary must be child or worker')\n  }\n  if (!Number.isInteger(options.trials) || options.trials < 1) {\n    throw new Error('--trials must be a positive integer')\n  }\n  return options\n}\n\nfunction electronPath() {\n  const requirePath = import.meta.resolve('electron')","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/hang-watchdog-memory-benchmark.mjs#L269-L305","documentation":"Thrown by parseArgs when a known flag (--boundary, --trials, or --output) is the last token on the command line with no following value. The parser reads argv[index+1] as the value; if it is undefined/falsy the flag is dangling.","triggerScenarios":"Invoking the benchmark with a trailing flag and no argument, e.g. `--boundary` at end of argv, or `--output` with nothing after it.","commonSituations":"Typos in CI workflow YAML, a truncated copy-pasted command, or shell quoting that swallowed the value.","solutions":["Provide a value after each flag: `--boundary child`, `--trials 7`, `--output report.json`.","Double-check CI scripts and shell aliases for truncated argument lists."],"exampleFix":"// before\nnode config/scripts/hang-watchdog-memory-benchmark.mjs --boundary\n// after\nnode config/scripts/hang-watchdog-memory-benchmark.mjs --boundary child","handlingStrategy":"validation","validationCode":"// Validate each flag has a value before consuming it\nfor (let i = 0; i < argv.length; i++) {\n  const a = argv[i]\n  if (a === '--boundary' || a === '--trials' || a === '--output') {\n    if (i + 1 >= argv.length || !argv[i + 1]) throw new Error(`Missing value for ${a}`)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair a flag with its value in CI workflow definitions.","Use a dedicated arg parser (e.g. commander/yargs) if the CLI grows beyond three flags."],"tags":["benchmark","cli","arguments","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}