{"record":{"id":"e99b170fbf6775ab","repo":"vercel/next.js","slug":"invalid-stream-mode-value-streammoderaw-use","errorCode":null,"errorMessage":"Invalid --stream-mode value: ${streamModeRaw}. Use node","messagePattern":"Invalid --stream-mode value: (.+?)\\. Use node","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"bench/render-pipeline/benchmark.ts","lineNumber":213,"sourceCode":"    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\n  return {\n    scenario: scenarioRaw,\n    jsonOut: args.get('json-out'),\n\n    appDir: resolve(REPO_ROOT, args.get('app-dir') ?? 'bench/basic-app'),\n    routes,\n    streamMode: streamModeRaw,","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/bench/render-pipeline/benchmark.ts#L195-L231","documentation":"Thrown by parseCli (benchmark.ts:213) when --stream-mode is anything other than 'node' (the default). The StreamMode type is currently just 'node' and the benchmark only implements the Node.js streaming path; other stream modes (e.g. a future edge/web-streams variant) are not wired up, so any other value is rejected to avoid silently benchmarking the wrong thing.","triggerScenarios":"Passing --stream-mode=edge, --stream-mode=web, or a bare --stream-mode (-> 'true'). The check is `if (streamModeRaw !== 'node')`, so literally anything other than 'node' fails, including the default when omitted is fine because the default IS 'node'.","commonSituations":"Assuming the benchmark supports the same stream modes as some other tool; passing --stream-mode=node explicitly is fine; anything else is not yet implemented.","solutions":["Use --stream-mode=node (the only implemented mode) or simply omit the flag.","Do not pass other values; if you need a different stream mode it must be implemented in the benchmark first.","Run --help to confirm the accepted value."],"exampleFix":"# before\n#   pnpm bench:render-pipeline --stream-mode=edge\n\n# after\n#   pnpm bench:render-pipeline --stream-mode=node\n# (or omit the flag entirely — node is the default)","handlingStrategy":"validation","validationCode":"const VALID_STREAM_MODES = new Set(['node'])\nfunction parseStreamMode(raw: string | undefined): 'node' {\n  const m = raw ?? 'node'\n  if (!VALID_STREAM_MODES.has(m)) throw new Error(`--stream-mode must be one of ${[...VALID_STREAM_MODES].join('|')}`)\n  return m as 'node'\n}","typeGuard":"function isValidStreamMode(s: string): s is 'node' {\n  return s === 'node'\n}","tryCatchPattern":"try {\n  const streamMode = parseStreamMode(args.get('stream-mode'))\n} catch (err) {\n  console.error((err as Error).message, '\\nCurrently only --stream-mode=node is implemented.')\n  process.exit(2)\n}","preventionTips":["Use --stream-mode=node or omit it (node is the default).","Other modes are not implemented yet; don't pass them.","When implementing a new mode, update the StreamMode type AND this check together.","Run --help to confirm."],"tags":["cli","argument-parsing","stream-mode","validation","render-pipeline"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}