Infinite 307 redirects on automatic locale detection when upgrading to anything greater than serverless-component@1.19.0
See original GitHub issueHey, there seems to be a bug with the latest serverless component with automatic locale detection.
Nextjs version: 10.2.2. Machine: Mac OSX
This is my nextjs configuration:
{
target: 'serverless',
devIndicators: {
autoPrerender: false,
},
i18n: {
locales: ['en', 'es'],
defaultLocale: 'en',
},
}
Here are my steps:
I updated to the latest alpha version of serverless component.
When my Language is ‘es’ (configured in google chrome settings) and I land on mywebsite.com/
I get redirected to mywebsite.com/es
and then I notice an infinite 307 redirects to /es
after this.
After downgrading to serverless-component@1.19.0
the issue stops happening.
Has anyone encountered this issue too?
Just a note, I have configured my cloudfront to not pass any cookies. (most likely not the cause)
cloudfront:
distributionId: XXXXXX
defaults:
forward:
cookies: 'none'
Let me know if there is any other information I can provide
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
RFC: I18n Routing · Discussion #17078 · vercel/next.js - GitHub
js itself! I just have one question: the automatic language detection will only run on the / route and automatically redirect to the...
Read more >Advanced Features: Internationalized Routing - Next.js
js will no longer automatically redirect based on the user's preferred locale and will only provide locale information detected from either the locale...
Read more >defaultLocale is not keeping default lang in Next.js i18n
js will no longer automatically redirect based on the user's preferred locale and will only provide locale information detected from either the ...
Read more >Advanced internationalization with Next.js and middleware
We turn off Next.js locale detection because we are going to handle that ourselves in the middleware. /** @type {import('next').NextConfig} ...
Read more >Automatic User Language Detection in TranslatePress
The Automatic User Language Detection add-on uses only soft redirects, which happen on the client side. But there's a problem: finding out the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I think I forgot to check to redirect only when on the root URI, I will fix it and add some tests for it
Yeah, I can guess. I’ll see if I can fix it.