{"record":{"id":"a635a28aa202897a","repo":"vercel/next.js","slug":"each-route-must-start-with-route-a635a2","errorCode":null,"errorMessage":"Each route must start with '/': ${route}","messagePattern":"Each route must start with '/': (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"bench/render-pipeline/client-trace.ts","lineNumber":169,"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 routes = (args.get('routes') ?? '/,/dashboard,/docs,/blog,/tailwind')\n    .split(',')\n    .map((route) => route.trim())\n    .filter(Boolean)\n  if (routes.length === 0) {\n    throw new Error('--routes cannot be empty')\n  }\n  for (const route of routes) {\n    if (!route.startsWith('/')) {\n      throw new Error(`Each route must start with '/': ${route}`)\n    }\n  }\n\n  const samples = parseNumberArg(args, 'samples', 3)\n  if (samples < 1) {\n    throw new Error(`--samples must be at least 1, got ${samples}`)\n  }\n  // CDP rejects rates below 1 (1 = no throttling).\n  const cpuThrottle = parseNumberArg(args, 'cpu-throttle', 4)\n  if (cpuThrottle < 1) {\n    throw new Error(`--cpu-throttle must be at least 1, got ${cpuThrottle}`)\n  }\n\n  const timestamp = new Date().toISOString().replace(/[:.]/g, '-')\n\n  return {\n    appDir: resolve(REPO_ROOT, args.get('app-dir') ?? 'bench/basic-app'),\n    routes,","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/bench/render-pipeline/client-trace.ts#L151-L187","documentation":"Thrown by parseCli during route validation when any individual route in --routes does not begin with a leading slash. App Router route paths are always root-absolute (/, /dashboard), so a missing slash indicates a user mistake that would silently fail to match a route.","triggerScenarios":"Passing --routes=dashboard,docs or --routes=http://localhost/x; forgetting the leading slash on the first segment.","commonSituations":"Typing a bare path segment; pasting a full URL instead of a path; an off-by-one in a script that strips the slash.","solutions":["Prefix every route with /, e.g. --routes=/,/dashboard.","If you pasted a full URL, extract just the pathname.","Re-run with --help to confirm the expected format."],"exampleFix":"// before\n--routes=dashboard,/docs\n// after\n--routes=/dashboard,/docs","handlingStrategy":"validation","validationCode":"function normalizeRoutes(raw: string): string[] {\n  return raw.split(',').map(r => r.trim()).filter(Boolean).map(r =>\n    r.startsWith('/') ? r : `/${r}`\n  )\n}","typeGuard":"const isValidRoute = (r: string): boolean => r.startsWith('/')","tryCatchPattern":"null","preventionTips":["Always prefix routes with /.","If accepting user input, normalize by prepending / when missing."],"tags":["cli","validation","routing"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}