-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
SSR broken in latest version of NextJS when setting locale manually #156
Comments
Try to downgrade your |
Having this problem as well. Were you able to fix this, @andycansdale? Update Seems like @QuickAmethyst 's suggestion worked. @JCQuintas looks like there is a specific dependency version requirement with |
@bombillazo can you send your package.json ? |
@vladislavdev58 just install the dependency with the exact version
Check the CHANGELOG for that package to see if it doesnt affect you having an older version from the latest one. It would be interesting to see which version broke the compatibility... |
@bombillazo thanks, I had with |
I had exactly the same error and I just used the @bombillazo suggestion, use the exact version of the react-i18next. Thank you! P.S. But I think it's a temporary solution because the react-i18next will continue to growing if the next.js will change API later |
It seems someone reported a related problem in the |
Hi, as far as I can tell this seems to have been caused by a version of
|
Hey JC. Unfortunately, using any version greater than |
Sorry, I misread, this is happening in development only. I was testing in production. Will try to debug it then |
When trying to load translations on the server side from within getServerSideProps, the props are loaded into the store, but fail to be applied to the html. When the client takes over, the translations are loaded. This also causes a mismatch error when fallbackLng is set to supportedLngs as in the example.
The issue is present in a fresh vanilla NextJS installation with files as follows:
pages/_app.tsx
ni18n.config.ts
pages/index.tsx
It's worth noting that the prop ni18n_server is being loaded with the translations, but whatever I try, I've not been able to get SSR to pick them up.
__ni18n_server__: { resources: { es: [Object], en: [Object] }, ns: [ 'translation' ] }
As can be seen here, the SSR response shows 'key' instead of the text 'Translation in English'. Once the client takes over, the translation is corrected in the view and the error is displayed.
package.json as follows:
The text was updated successfully, but these errors were encountered: