-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
i18next pages flash when loaded #697
Comments
This is not an issue - there somewhere is a mistake in your code -> not passing proper initial data down to client from the server. Rolling this proper needs a deep understanding of both next.js and i18next -> my tip head over to https://github.com/isaachinman/next-i18next and adapt the solution there - will save you a lot of pain. On the way there do not forget to star this repo 🙏 |
Thanks for the quick response. I'm not using next.js, it's my own standard SSR implementation in typescript. I followed the react-i18next razzle SSR example. Any idea what could be wrong in my config? Already liked the repo by the way. |
🤷♂️ hard to tell - from the config i do not see a problem on the first glance - you will need to debug through this. Or simplify it by not using XHR stuff and hard code the translations on init options.resources (so no async loading happens) |
please start adding changes related to the v9 version to the v9.x.x branch (master will be now for the upcoming v10 hooks) |
closing this for now - can't really help |
I’m using typescript, SSR and react-18next. When I load or refresh a page, you can see the DOM tree flash on every reload. There is also a warning on the browser console:
“Warning: Did not expect server HTML to contain a <div> in <div>.”
If I replace
react: {wait: true}
withinitImmediate: false
, the DOM does no longer flash and the browser warning disappears“Warning: Did not expect server HTML to contain a <div> in <div>.”
However I get a set of“i18next::translator: missingKey”
and some warnings that“Warning: Text content did not match. Server:…”
Not sure what can be done to fix this.
Versions -
i18n.ts
client.ts
server.ts
The text was updated successfully, but these errors were encountered: