Strange Locale Switching Behavior with NEXT_LOCALE Cookie - Need Help with Debugging #1941
Replies: 1 comment 2 replies
-
That sounds very odd to me. Are you sure you don't mean But it's still strange that the cookie value changes back to Any chance you could share a link to your app in case it's public? Some way to reproduce it would certainly help, currently there's a lot of guessing here. I'd really try to break it down as much as possible, e.g. by removing most of your code and see what the minimal case is where you can still see the issue. From there, looking at each request in isolation until you find the invalid one might help—e.g. if you can break it down to a single |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
First, let me share the repository structure:
https://github.com/FrontLeejonghun/next-intl-replace-bug
Current Issue:
Unfortunately, this issue cannot be reproduced in the repository above, but it consistently occurs in my production application. The next-intl and Next.js versions are identical between both environments.
Steps to Reproduce (in my production app):
/
/ko
based on locale detectionen
using the locale switcherNEXT_LOCALE
cookie changes:ko
→en
→ko
, and in the Network tab, I see a307 redirect
→/ko_rsc111
Environment Details:
Important Note:
The application works perfectly fine with
next-intl: ^3.11.3
, but this issue appears with newer versions.Question:
Has anyone experienced similar behavior with locale switching where the
NEXT_LOCALE
cookie oscillates between values and generates unexpected redirect URLs with suffixes like_rsc111
?Any insights into what might cause this discrepancy between environments would be greatly appreciated. I'm particularly curious about what could cause the cookie to flip back and forth and generate those unusual redirect URLs.
Additional Context:
Thank you for your time and any suggestions you might have!
Beta Was this translation helpful? Give feedback.
All reactions