{"record":{"id":"0c0cf952c200f383","repo":"vercel/next.js","slug":"invalid-scenario-value-scenarioraw-use-e2e","errorCode":null,"errorMessage":"Invalid --scenario value: ${scenarioRaw}. Use e2e|minimal-server","messagePattern":"Invalid --scenario value: (.+?)\\. Use e2e\\|minimal-server","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"bench/render-pipeline/benchmark.ts","lineNumber":206,"sourceCode":"  if (rawArgs.includes('--help')) {\n    usage()\n    process.exit(0)\n  }\n\n  const args = new Map<string, string>()\n  for (const rawArg of rawArgs) {\n    if (!rawArg.startsWith('--')) continue\n    const eq = rawArg.indexOf('=')\n    if (eq === -1) {\n      args.set(rawArg.slice(2), 'true')\n    } else {\n      args.set(rawArg.slice(2, eq), rawArg.slice(eq + 1))\n    }\n  }\n\n  const scenarioRaw = args.get('scenario') ?? 'e2e'\n  if (scenarioRaw !== 'minimal-server' && scenarioRaw !== 'e2e') {\n    throw new Error(\n      `Invalid --scenario value: ${scenarioRaw}. Use e2e|minimal-server`\n    )\n  }\n\n  const streamModeRaw = args.get('stream-mode') ?? 'node'\n  if (streamModeRaw !== 'node') {\n    throw new Error(`Invalid --stream-mode value: ${streamModeRaw}. Use node`)\n  }\n\n  const timestamp = new Date().toISOString().replace(/[:.]/g, '-')\n  const artifactDir = resolve(\n    REPO_ROOT,\n    args.get('artifact-dir') ?? `bench/render-pipeline/artifacts/${timestamp}`\n  )\n\n  const routes = parseRoutes(args.get('routes'))\n  const build = parseBoolean(args.get('build') ?? 'true')\n","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/bench/render-pipeline/benchmark.ts#L188-L224","documentation":"Thrown by parseCli (benchmark.ts:206) when --scenario is something other than 'e2e' or 'minimal-server' (the default is 'e2e'). These two scenarios select entirely different server setups: e2e runs a real `next build` + `next start`, minimal-server runs NextServer with minimalMode and no router-server against bench/next-minimal-server. Any other value is meaningless and rejected up front.","triggerScenarios":"Passing --scenario=edge, --scenario=production, --scenario=node, or a typo like --scenario=minimal (missing -server). A bare --scenario resolves to 'true' which also fails.","commonSituations":"Guessing scenario names; copy from docs that referenced an old/renamed scenario; truncating 'minimal-server' to 'minimal'.","solutions":["Use exactly e2e or minimal-server: --scenario=e2e (default) or --scenario=minimal-server.","Spell minimal-server in full; there is no short alias.","Run with --help to see current valid values.","If you need a new scenario, add it to the Scenario type and the branch in main(); don't bypass the check."],"exampleFix":"# before\n#   pnpm bench:render-pipeline --scenario=minimal\n\n# after\n#   pnpm bench:render-pipeline --scenario=minimal-server","handlingStrategy":"validation","validationCode":"const VALID_SCENARIOS = new Set(['e2e', 'minimal-server'])\nfunction parseScenario(raw: string | undefined): 'e2e' | 'minimal-server' {\n  const s = raw ?? 'e2e'\n  if (!VALID_SCENARIOS.has(s)) throw new Error(`--scenario must be one of ${[...VALID_SCENARIOS].join('|')}`)\n  return s as 'e2e' | 'minimal-server'\n}","typeGuard":"function isValidScenario(s: string): s is 'e2e' | 'minimal-server' {\n  return s === 'e2e' || s === 'minimal-server'\n}","tryCatchPattern":"try {\n  const scenario = parseScenario(args.get('scenario'))\n} catch (err) {\n  console.error((err as Error).message, '\\nValid scenarios: e2e | minimal-server')\n  process.exit(2)\n}","preventionTips":["Use exactly 'e2e' or 'minimal-server'; spell minimal-server in full.","Omit the flag to get the default (e2e).","Run --help to confirm accepted values.","Update VALID_SCENARIOS and the Scenario type together when adding a scenario."],"tags":["cli","argument-parsing","scenario","validation","render-pipeline"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}