Skip to content

[@netlify/plugin-nextjs:5.10.7] infinity loop on netlify with next-intl enabled #2863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mschel opened this issue Apr 22, 2025 · 4 comments
Closed

Comments

@mschel
Copy link

mschel commented Apr 22, 2025

Hi there - my Next.js:15.3.1 site using middleware with next-intl:3.26.5 enabled and has rewrites stopped working on Netlify after upgrading from plugin-nextjs:5.10.6 to plugin-nextjs:5.10.7.

The default language for i18n is de redirecting to / (https://next-intl.dev/docs/routing).
The following Header is set: x-middleware-rewrite: /de for the request /.

If you use /enfor the English version, no redirect will be triggered as /en is a valid URL segment. In this case, the website will work as expected.

The selected language (the i18n plugin detects the browser language) will be saved in a Cookie NEXT_LOCALE=de. Disabling this behavior via localeCookie: false (https://next-intl.dev/docs/routing#locale-cookie) does not fix the issue.

It seems like the new Cookie behavior of the plugin does not work with the next-intl plugin.

Best
Marcel

@mschel mschel changed the title [@netlify/plugin-nextjs:5.10.7] infinity loop on netlify after upgrading [@netlify/plugin-nextjs:5.10.7] infinity loop on netlify with next-intl enabled Apr 22, 2025
@mschel
Copy link
Author

mschel commented Apr 23, 2025

A little update - just tried to run the latest plugin with next-intl@4.0.3 with no success.

@mrstork
Copy link
Contributor

mrstork commented Apr 25, 2025

@mschel Are you still able to reproduce the issue? The reproduction I had created for this issue is now working as intended, so curious if it's also resolved on your end.

@mschel
Copy link
Author

mschel commented Apr 25, 2025

hey @mrstork many thanks. It seems like it is working now. In the meantime I've upgraded to next-intl@4.1.0 - what did you change on your side?

@mrstork
Copy link
Contributor

mrstork commented Apr 25, 2025

There was a platform change that resolved this issue. Thank you for the issue report!

@mrstork mrstork closed this as completed Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants