moeru-ai/airi · error · Error
Unsupported route path "${routePath}". Route paths must star
Error message
Unsupported route path "${routePath}". Route paths must start with "/". What it means
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.
Source
Thrown at packages/scenarios-stage-tamagotchi-browser/scripts/capture.ts:63
speed: avifSpeed,
})
await writeFile(derivedFilePath, avifBuffer)
await rm(artifact.filePath, { force: true })
return {
...artifact,
filePath: derivedFilePath,
format: 'avif',
}
}
if (!['png', 'avif'].includes(requestedFormat)) {
throw new Error(`Unsupported capture format "${requestedFormat}". Expected "png" or "avif".`)
}
if (!routePath?.startsWith('/')) {
throw new Error(`Unsupported route path "${routePath}". Route paths must start with "/".`)
}
if (outputDirFlagIndex >= 0 && !argv[outputDirFlagIndex + 1]) {
throw new Error('Missing value for --output-dir.')
}
if (settleMsFlagIndex >= 0 && !argv[settleMsFlagIndex + 1]) {
throw new Error('Missing value for --settle-ms.')
}
if (avifMaxWidthFlagIndex >= 0 && !argv[avifMaxWidthFlagIndex + 1]) {
throw new Error('Missing value for --avif-max-width.')
}
if (avifQualityFlagIndex >= 0 && !argv[avifQualityFlagIndex + 1]) {
throw new Error('Missing value for --avif-quality.')
}
View on GitHub (pinned to 27111382b4)
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.
Example fix
// before node scripts/capture.ts --route settings // after node scripts/capture.ts --route /settings
Defensive patterns
Strategy: validation
Validate before calling
function normalizeRoute(route: string): string {
return route.startsWith('/') ? route : `/${route}`
}
if (!normalizeRoute(routePath).startsWith('/')) {
throw new Error(`Invalid route path: ${routePath}`)
} Type guard
function isAbsoluteRoute(route: string): boolean {
return route.startsWith('/')
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unsupported capture format "${requestedFormat}". Expected "p
- Missing value for --output-dir.
- Missing value for --settle-ms.
- cap-vite [vite args...] -- <ios|android> [cap run args...]
- Missing value for `${optionName}`.
AI-assisted analysis of moeru-ai/airi@27111382b4 (2026-08-12).
Data as JSON: /api/errors/e701cd12714972c0.
Report an issue: GitHub.