{"record":{"id":"763c9a49ff13fadd","repo":"n8n-io/n8n","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":"packages/@n8n/instance-ai/evaluations/export-latest-verifier-request.ts","lineNumber":89,"sourceCode":"const evalResultsPath = path.join(instanceAiRoot, 'eval-results.json');\nconst sqliteDbPath = path.join(repoRoot, '.n8n-instance-ai', '.n8n', 'database.sqlite');\n\ntype CliArgs = {\n\ttestCasePath: string;\n\tscenarioName?: string;\n};\n\nfunction parseCliArgs(argv: string[]): CliArgs {\n\tlet testCasePath: string | undefined;\n\tlet scenarioName: string | undefined;\n\n\tfor (let i = 0; i < argv.length; i++) {\n\t\tconst arg = argv[i];\n\t\tswitch (arg) {\n\t\t\tcase '--test-case':\n\t\t\tcase '--slug': {\n\t\t\t\tconst slug = argv[++i];\n\t\t\t\tif (!slug) throw new Error(`Missing value for ${arg}`);\n\t\t\t\ttestCasePath = path.join(\n\t\t\t\t\tinstanceAiRoot,\n\t\t\t\t\t'evaluations',\n\t\t\t\t\t'data',\n\t\t\t\t\t'workflows',\n\t\t\t\t\t`${slug}.json`,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '--test-case-path': {\n\t\t\t\tconst rawPath = argv[++i];\n\t\t\t\tif (!rawPath) throw new Error('Missing value for --test-case-path');\n\t\t\t\ttestCasePath = path.resolve(process.cwd(), rawPath);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '--scenario': {\n\t\t\t\tscenarioName = argv[++i];\n\t\t\t\tif (!scenarioName) throw new Error('Missing value for --scenario');","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/export-latest-verifier-request.ts#L71-L107","documentation":"Thrown by `parseCliArgs()` in export-latest-verifier-request.ts when `--test-case` or `--slug` is the last token on the command line (the `argv[++i]` lookup returned undefined). This CLI is the one that exports the latest verifier request payload; `--test-case`/`--slug` take a slug that gets joined to `evaluations/data/workflows/<slug>.json`. Distinct from the computer-use CLI's 'Missing value' (which also rejects a following `--`); this parser only checks for absence.","triggerScenarios":"`--slug` with no following token. A shell-interpolated `${SLUG}` that resolved to empty. The flag was the last token because the rest of the line was truncated.","commonSituations":"CI script forgetting to set the slug env var. Copy-pasting a partial command. A wrapper that conditionally includes `--slug` but forgets the value when the condition is true.","solutions":["Supply the slug immediately after the flag: `--slug cross-team-linear-report`.","If the slug came from an env var, ensure it's set and non-empty before invoking.","Use the positional form instead: `node export-latest-verifier-request.ts <slug>` (the parser accepts a bare slug as test-case when no `--scenario` was set)."],"exampleFix":"// before\n$ node export-latest-verifier-request.ts --slug\n// after\n$ node export-latest-verifier-request.ts --slug cross-team-linear-report","handlingStrategy":"validation","validationCode":"const VALUE_FLAGS = new Set(['--test-case','--slug','--test-case-path','--scenario']);\nfunction checkMissingValues(argv: string[]): string[] {\n  const missing: string[] = [];\n  for (let i = 0; i < argv.length; i++) {\n    if (VALUE_FLAGS.has(argv[i]) && argv[i + 1] === undefined) missing.push(argv[i]);\n  }\n  return missing;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In wrapper scripts, assert each value-flag has a non-empty substitution target before invoking.","Prefer the positional form (`<slug> [scenario]`) for shorter commands less prone to dangling flags."],"tags":["cli","argument-parsing","verifier-export","configuration","developer-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}