Next.js routing conflict blocking AAI portal deployment

Source type: obs · Harvested: 2026-05-02 · Original date: 2026-05-01T19:47:07.865Z Metadata: {"project":"lunhsiangyuan","type":"bugfix","obs_id":64825}


obs/64825 · bugfix · 2026-05-01T19:47:07.865Z

Next.js routing conflict blocking AAI portal deployment

Portal redeployment attempted to pick up updated AAI_INTERNAL_ACCESS environment variables but failed due to Next.js routing conflict. The error surfaces a fundamental Next.js constraint: you cannot have both a specific dynamic segment route ([slug]) and an optional catch-all route (…path) at the same level because they have ambiguous specificity - Next.js cannot determine which route should handle a request like /internal/wiki/my-slug. Investigation revealed three nested route directories under /app/[locale]/internal/wiki, with the deepest level containing an optional catch-all. This architectural issue prevents the build from completing and blocks deployment of the updated whitelist to production. The whitelist was successfully updated in Vercel environment variables, but the portal application cannot redeploy to consume those variables until the routing conflict is resolved.

Concepts: [“problem-solution”,“gotcha”,“how-it-works”]

Facts: [“Vercel production deployment failed with “bun run build” exit code 1”,“Next.js build error: “You cannot define a route with the same specificity as an optional catch-all route"",“Conflicting routes identified: /[locale]/internal/wiki/[slug] and /[locale]/internal/wiki/[slug]/…path”,“Three route directories exist: /app/[locale]/internal/wiki, /app/[locale]/internal/wiki/[slug], /app/[locale]/internal/wiki/[slug]/…path”,“Catch-all route contains route.ts file”]



[← 回 Alfred Brain Hub]