{"record":{"id":"e701cd12714972c0","repo":"moeru-ai/airi","slug":"unsupported-route-path-routepath-route-paths","errorCode":null,"errorMessage":"Unsupported route path \"${routePath}\". Route paths must start with \"/\".","messagePattern":"Unsupported route path \"(.+?)\"\\. Route paths must start with \"/\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts","lineNumber":63,"sourceCode":"    speed: avifSpeed,\n  })\n\n  await writeFile(derivedFilePath, avifBuffer)\n  await rm(artifact.filePath, { force: true })\n\n  return {\n    ...artifact,\n    filePath: derivedFilePath,\n    format: 'avif',\n  }\n}\n\nif (!['png', 'avif'].includes(requestedFormat)) {\n  throw new Error(`Unsupported capture format \"${requestedFormat}\". Expected \"png\" or \"avif\".`)\n}\n\nif (!routePath?.startsWith('/')) {\n  throw new Error(`Unsupported route path \"${routePath}\". Route paths must start with \"/\".`)\n}\n\nif (outputDirFlagIndex >= 0 && !argv[outputDirFlagIndex + 1]) {\n  throw new Error('Missing value for --output-dir.')\n}\n\nif (settleMsFlagIndex >= 0 && !argv[settleMsFlagIndex + 1]) {\n  throw new Error('Missing value for --settle-ms.')\n}\n\nif (avifMaxWidthFlagIndex >= 0 && !argv[avifMaxWidthFlagIndex + 1]) {\n  throw new Error('Missing value for --avif-max-width.')\n}\n\nif (avifQualityFlagIndex >= 0 && !argv[avifQualityFlagIndex + 1]) {\n  throw new Error('Missing value for --avif-quality.')\n}\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts#L45-L81","documentation":"Thrown by the capture.ts CLI guard when the --route value does not start with '/'. The value is passed straight to captureBrowserRoots as a browser route path, and the check enforces router-absolute paths; relative fragments, bare route names, or full URLs all fail. Default is '/docs/setup-and-use' when the flag is omitted.","triggerScenarios":"Running with --route chat, --route ./chat, or --route https://localhost:3000/chat; building the flag from a routes list that stores names without the leading slash; quoting issues that prepend whitespace; a missing value after --route yielding undefined.","commonSituations":"CI capture jobs iterating over app routes stored without leading slashes; copying a URL instead of its path; wrapper scripts interpolating variables that are sometimes empty or relative.","solutions":["Pass an absolute app path: pnpm capture -- --route /chat.","Normalize in wrappers: --route \"/${ROUTE#/}\" to guarantee the leading slash.","If starting from a URL, strip the origin first (new URL(u).pathname).","Ensure a value actually follows --route on the command line."],"exampleFix":"# before\npnpm capture -- --route chat # throws: Route paths must start with \"/\"\n\n# after\npnpm capture -- --route /chat","handlingStrategy":"validation","validationCode":"// Normalize route lists before invoking capture.ts:\nconst routes = ['/chat', 'settings'].map(r => r.startsWith('/') ? r : `/${r}`)\nfor (const route of routes) {\n  if (!route.startsWith('/')) throw new Error(`Bad route: ${route}`)\n}","typeGuard":"const isAbsoluteRoutePath = (value: string): boolean => value.startsWith('/')\n// use: routes.filter(isAbsoluteRoutePath) or assert before exec","tryCatchPattern":null,"preventionTips":["Store route names with the leading slash in route registries/configs.","When copying from a URL, pass new URL(u).pathname, not the full URL.","Always provide a value after --route on the command line."],"tags":["capture-script","cli","arguments","routing"],"backgroundTag":"invalid-cli-argument","analyzedSha":"677329427f32468c74b17f3ec47eeca4e05bec65","analyzedAt":"2026-08-18T17:29:58.153Z","contentChangedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}