{"record":{"id":"c716d31730e3b6ec","repo":"withastro/astro","slug":"error-generating-routes-normalized-error-messag","errorCode":null,"errorMessage":"Error generating routes: ${normalized.error.message}","messagePattern":"Error generating routes: (.+?)","errorType":"exception","errorClass":"AstroError","httpStatus":null,"severity":"error","filePath":"packages/integrations/vercel/src/index.ts","lineNumber":611,"sourceCode":"\t\t\t\t\t\tdomains:\n\t\t\t\t\t\t\timagesConfig.domains || _config.image.domains\n\t\t\t\t\t\t\t\t? [...(imagesConfig.domains ?? []), ...(_config.image.domains ?? [])]\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tremotePatterns: [...(imagesConfig.remotePatterns ?? [])],\n\t\t\t\t\t};\n\t\t\t\t\tconst remotePatterns = _config.image.remotePatterns;\n\t\t\t\t\tfor (const pattern of remotePatterns) {\n\t\t\t\t\t\tif (isAcceptedPattern(pattern)) {\n\t\t\t\t\t\t\timages.remotePatterns?.push(pattern);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (imageService) {\n\t\t\t\t\timages = getDefaultImageConfig(_config.image);\n\t\t\t\t}\n\n\t\t\t\tconst normalized = normalizeRoutes([...(redirects ?? []), ...finalRoutes]);\n\t\t\t\tif (normalized.error) {\n\t\t\t\t\tthrow new AstroError(\n\t\t\t\t\t\t`Error generating routes: ${normalized.error.message}`,\n\t\t\t\t\t\tnormalized.error.link\n\t\t\t\t\t\t\t? `${normalized.error.action ?? 'More info'}: ${normalized.error.link}`\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (_routeToHeaders && _routeToHeaders.size > 0) {\n\t\t\t\t\tif (!normalized.routes) {\n\t\t\t\t\t\tnormalized.routes = [];\n\t\t\t\t\t}\n\t\t\t\t\tif (staticHeaders) {\n\t\t\t\t\t\tconst routesWithConfigHeaders = createRoutesWithStaticHeaders(_routeToHeaders, _config);\n\t\t\t\t\t\tconst fileSystemRouteIndex = normalized.routes.findIndex(\n\t\t\t\t\t\t\t(r) => 'handle' in r && r.handle === 'filesystem',\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnormalized.routes.splice(fileSystemRouteIndex, 0, ...routesWithConfigHeaders);\n\t\t\t\t\t}","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/withastro/astro/blob/d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca/packages/integrations/vercel/src/index.ts#L593-L629","documentation":"Thrown by the Vercel adapter when `normalizeRoutes()` (combining redirects + final routes) returns an `error`. This is a broader routing-consistency failure than the redirect-only check, covering conflicts between your Astro routes and Vercel's route table (duplicate paths, conflicting rewrites, invalid patterns).","triggerScenarios":"Two routes resolving to the same normalized path. A route pattern Vercel cannot represent. Redirects colliding with page routes. Inconsistent `trailingSlash`/`build.format` producing ambiguous outputs.","commonSituations":"Migrating routes that overlap. Adding a redirect that targets an existing page route. Changing `build.format` ('file' vs 'directory') without updating redirects.","solutions":["Inspect `normalized.error.message` and `normalized.error.link` for the precise conflict.","Eliminate duplicate or overlapping route paths across pages and redirects.","Make `trailingSlash` and `build.format` consistent so normalized paths are unique."],"exampleFix":"// before: page route /about and redirect /about -> /about/ collide\n// after: remove the redirect or rename the page\nexport default defineConfig({\n  redirects: { '/about-old': '/about/' },\n});","handlingStrategy":"try-catch","validationCode":"const normalized = normalizeRoutes([...redirects, ...routes]);\nif (normalized.error) { console.error('Route conflict:', normalized.error.message); }","typeGuard":"function hasNormalizedError(r: unknown): r is { error: { message: string } } {\n  return !!(r as any)?.error;\n}","tryCatchPattern":"try { /* build */ } catch (e) { if (/Error generating routes/) { /* dedupe overlapping routes */ } else throw e; }","preventionTips":["Avoid overlapping page and redirect paths.","Keep `trailingSlash` and `build.format` consistent.","Review route tables after migrations."],"tags":["vercel","routing","build","route-conflict"],"backgroundTag":null,"analyzedSha":"d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca","analyzedAt":"2026-08-12T13:37:29.035Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}