SSR can be tricky, mostly because every framework does things its own way. Loaders, lifecycles, hydration, serialization all behave a little differently depending on where you are, so wiring up something like i18next is rarely a copy-paste between frameworks. i18next has solid SSR support, but how you connect it still depends on the framework you're using.
This post focuses on TanStack Start specifically:
- Detecting the user's preferred language on the server.
- Initializing separate i18next instances for server and client.
- Safely passing an i18next instance across the server-to-client boundary without things quietly breaking.
By the end you'll have a working pattern that you can adapt to your own projects.
If you'd rather learn by reading the finished code, the full project is on GitHub:
Good luck!
SOCIAL SHARE CARD GENERATOR