Open gabrielf opened 8 months ago
Same issue here using pages router + middleware and Next js 14.1. When disabling the middleware it works just fine.
Weird how 13/14 can be considered stable if translations become completely broken when updating ...
Link to the code that reproduces this issue
https://github.com/gabrielf/next-edge-runtime-locale-bug
To Reproduce
npm run dev
http://localhost:3000/en
in a browserCurrent vs. Expected behavior
As I visit
/en
I expect the locale to been
but it isdefault
.Clicking the link
English
leads to a client side navigation to the same page which correctly shows the locale asen
.Additional links and their purpose:
Dynamic route 1
- exists to show that the problem exists also for dynamic routes, not just static onesStatic route (unaffected)
- exists to show that the problem does not exist on routes that does not match the middlewareProvide environment information
Which area(s) are affected? (Select all that apply)
Internationalization (i18n), Middleware / Edge (API routes, runtime), Routing (next/router, next/navigation, next/link)
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local)
Additional context
The bug may have been introduced in version 13.4.20-canary.24 as using 13.4.20-canary.23 works fine but 24 does not. The bug seems to have existed since then.