{"record":{"id":"0cdf91ce212b2a0a","repo":"stablyai/orca","slug":"unknown-argument-arg-0cdf91","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/rebuild-native-deps.mjs","lineNumber":369,"sourceCode":"      continue\n    }\n    if (arg === '--platform') {\n      options.platform = readRequiredArgValue(args, (index += 1), '--platform')\n      continue\n    }\n    if (arg.startsWith('--platform=')) {\n      options.platform = readInlineArgValue(arg, '--platform')\n      continue\n    }\n    if (arg === '--arch') {\n      options.arch = readRequiredArgValue(args, (index += 1), '--arch')\n      continue\n    }\n    if (arg.startsWith('--arch=')) {\n      options.arch = readInlineArgValue(arg, '--arch')\n      continue\n    }\n    throw new Error(`Unknown argument: ${arg}`)\n  }\n  return options\n}\n\nfunction readRequiredArgValue(args, index, flag) {\n  const value = args[index]\n  if (!value || value.startsWith('--')) {\n    throw new Error(`Missing value for ${flag}`)\n  }\n  return value\n}\n\nfunction readInlineArgValue(arg, flag) {\n  const value = arg.slice(`${flag}=`.length)\n  if (!value) {\n    throw new Error(`Missing value for ${flag}`)\n  }\n  return value","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/rebuild-native-deps.mjs#L351-L387","documentation":"Thrown by the readCliOptions arg parser in config/scripts/rebuild-native-deps.mjs when it encounters a CLI token that is not one of the recognized flags (--force, --platform, --platform=, --arch, --arch=). The parser is intentionally strict so typos fail loudly instead of being silently ignored. After all known-flag branches at lines 349-368 are exhausted, line 369 throws for the unknown token.","triggerScenarios":"Run `node config/scripts/rebuild-native-deps.mjs --verbsoe` (typo), `--verbose`, `--target=x64`, or any unsupported flag. Only --force, --platform[=], and --arch[=] are accepted.","commonSituations":"A developer assumes the script shares flags with @electron/rebuild or electron-builder (e.g. --target, --types, --dir) and passes one of those. Typos like `--platfrom` are the other common cause.","solutions":["Remove the unsupported flag — the script only accepts --force, --platform[=value], --arch[=value].","Check the spelling of the flag you intended (--platform, not --platfrom).","Pass --help-less usage by reading the parser at lines 345-372 if unsure which flags exist."],"exampleFix":"// before\nnode config/scripts/rebuild-native-deps.mjs --target=x64\n\n// after\nnode config/scripts/rebuild-native-deps.mjs --arch x64","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['--force', '--platform', '--arch'])\nfor (const arg of args) {\n  const head = arg.split('=')[0]\n  if (arg.startsWith('--') && !KNOWN.has(head)) {\n    throw new Error(`Unknown argument: ${arg}. Supported: --force, --platform[=], --arch[=]`)\n  }\n}","typeGuard":"const KNOWN_FLAGS = new Set(['--force', '--platform', '--arch'])\nfunction isKnownFlag(arg) {\n  return KNOWN_FLAGS.has(arg) || KNOWN_FLAGS.has(arg.split('=')[0]) && arg.includes('=')\n}","tryCatchPattern":null,"preventionTips":["Only --force, --platform[=value], --arch[=value] are accepted — do not pass @electron/rebuild flags.","Double-check flag spelling (--platform, not --platfrom).","Prefer the inline `--flag=value` form to reduce next-slot errors."],"tags":["cli","args","config","build","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}