{"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":"validation","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/27111382b4a79a7e983289d6e983a06af185ed0f/packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts#L45-L81","documentation":"Thrown by the capture script's argument validation when the route path does not start with a forward slash. The script navigates the running app to the given route via a router that requires absolute paths, so a relative or malformed route string is rejected before capture begins.","triggerScenarios":"Passing a route argument like `settings`, `#/chat`, or `chat/` (missing leading `/`) to the capture script. Also triggered by routes built from joined segments that drop the leading slash, or by copying a fragment-only URL.","commonSituations":"Contributors passing a bare page name instead of the route path; wrapper scripts that join segments without ensuring a leading `/`; copied URLs that include only the hash portion.","solutions":["Prefix the route with `/` so it is an absolute path (e.g. `/settings`, `/devtools/...`).","In wrapper scripts, normalize the route with `route.startsWith('/') ? route : '/' + route` before passing it in.","If using a hash-based URL, extract the path portion and ensure it begins with `/`.","Confirm the route exists in the app's router config before capturing."],"exampleFix":"// before\nnode scripts/capture.ts --route settings\n\n// after\nnode scripts/capture.ts --route /settings","handlingStrategy":"validation","validationCode":"function normalizeRoute(route: string): string {\n  return route.startsWith('/') ? route : `/${route}`\n}\nif (!normalizeRoute(routePath).startsWith('/')) {\n  throw new Error(`Invalid route path: ${routePath}`)\n}","typeGuard":"function isAbsoluteRoute(route: string): boolean {\n  return route.startsWith('/')\n}","tryCatchPattern":null,"preventionTips":["Always pass route paths with a leading '/' to the capture script.","Normalize joined route segments in wrapper scripts to guarantee a leading slash.","Strip hash/protocol prefixes before passing a URL-derived route.","Confirm the route exists in the app's router before capturing."],"tags":["capture-script","cli","validation","routing"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}