Skip to content

Fix App Router locale path matching with Pages i18n - #98095

Merged
timneutkens merged 3 commits into
canaryfrom
codex/fix-app-i18n-runtime-routing
Sep 16, 2026
Merged

timneutkens merged 3 commits into
canaryfrom
codex/fix-app-i18n-runtime-routing

Conversation

@timneutkens

@timneutkens timneutkens commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix hybrid App Router and Pages Router projects using Pages i18n so explicit or rewritten locale segments remain available to App Router route matching, while Pages routes continue using locale-normalized paths.

The built-in filesystem matcher now carries each route owner through RouteKind, avoids duplicate App routes being treated as Pages routes in production, and preserves literal App path parameters through the router server, direct route-module invocation, and static export paths. The same ownership information is maintained by the development bundler.

Adds regression coverage for domain locales, proxy rewrites, exact and dynamic App pages, catch-all parameters, route handlers, inferred default locales, and Pages routes. Adapter-generated routing metadata is intentionally handled in the follow-up layers #97366 and #97500.

Closes #86048

Verification

  • pnpm build-all
  • NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-webpack test/e2e/app-dir/i18n-app-pages-domain-routing/i18n-app-pages-domain-routing.test.ts (9 passed)
  • Prettier and ESLint checks on all changed files

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 3f46982

@timneutkens timneutkens changed the title codex/fix app i18n runtime routing Fix App Router locale path matching with Pages i18n Aug 31, 2026
@timneutkens
timneutkens force-pushed the codex/fix-app-i18n-runtime-routing branch from 592f990 to 3f46982 Compare August 31, 2026 09:38
@timneutkens
timneutkens marked this pull request as ready for review August 31, 2026 10:30
@timneutkens
timneutkens requested a review from gnoff August 31, 2026 10:31
@timneutkens
timneutkens merged commit 1d5dd67 into canary Sep 16, 2026
262 of 264 checks passed
@timneutkens
timneutkens deleted the codex/fix-app-i18n-runtime-routing branch September 16, 2026 08:40
timneutkens added a commit that referenced this pull request Sep 16, 2026
Reverts #98095

A stale merge of #98095 caused failures on canary:
https://github.com/vercel/next.js/actions/runs/35075051322

Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App Router routes return 404 when using Pages Router i18n with domain routing

2 participants