Static props not working if i18n is active and catch-all-route is present in root folder #39255
Closed
1 task done
Labels
bug
Issue was opened via the bug report template.
Verify canary release
Provide environment information
But the Problem only occurs on the vercel platform in production and preview deployments
What browser are you using? (if relevant)
Chrome with german default language
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
Could not fetch static props for index page if i18n is enabled and a [...slugs] catch all route is used in pages root directory.
By using the network inspector we can see that one version of the static props (the one which is not the default locale) get's redirected to the page instead of receiving the static props json.
Expected Behavior
All static props files should receive there content and not anything else. Therefore the wrong redirect has to be fixed.
Link to reproduction
https://github.com/trieb-work/routing-issue-example
To Reproduce
0.) Visit https://routing-issue-example-gcczuzlft-triebwork.vercel.app
1.) go to chrome network manager and disable cache to make sure no static props request is in the cache. Also start the recording and filter for XHR so you can see the static props requests
2.) visit index page with / (with german browser language settings to make sure you are not redirected to /en version)
3.) in the network manager you can see that en.json request was redirected (status 307) which is kinda strange and probably the reason why step 4.) has some problems
4.) make sure you are still on the default locale 'de' version (/ without en or de) and then click on /en button.
5.) After switch to EN version the page could not load the static props and behind
Demo:
no string appears. Instead it should say:Demo: static props are working (index page)
. Also check the console for the static props log so you can see that an empty object was received as static props.6.) Also notice that if you directly visit the /en page everthing is working (probably because it is using the static props from the preprendered page an not from the ones which are redirected)
The text was updated successfully, but these errors were encountered: