Routing pattern consistency
Why it matters
Next.js routing resolution between app/ and pages/ follows non-obvious precedence rules: App Router wins for matching segments, but Pages Router catches everything App Router does not claim. Deploying a half-migrated app can change which route renders simply because someone added or removed a file, with no local indication. SEO metadata, layouts, and data-fetching conventions differ completely between the two routers, producing broken canonical URLs and duplicated or missing OG tags.
Severity rationale
Medium because resolution ambiguity can swap which page renders at a given URL without any code change to that page.
Remediation
Finish the migration to App Router. Enumerate what remains:
find pages -type f -name "*.tsx" | grep -vE '_app|_document|_error|api/'
Move each remaining page into app/ (e.g., pages/about.tsx becomes app/about/page.tsx), port getServerSideProps to server components or route handlers, then delete the old file. Keep pages/api/ until those endpoints are migrated to app/api/ route handlers. Redeploy and verify every URL resolves through the expected router.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Multi-Session Drift Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-slop-code-drift·automated