next-i18next not working correctly with wrapped tRPC when SSR is enabled
See original GitHub issueDescribe the bug
When wrapping an app with withTRPC
that is already wrapped with appWithTranslation
leads to the error react-i18next:: You will need pass in an i18next instance by using initReactI18next
on the server console when SSR is enabled for tRPC (otherwise everything works fine).
I also opened an issue at next-i18next (https://github.com/isaachinman/next-i18next/issues/1682) as I am not sure which “fault” it is. Just stumbled upon it.
Occurs in next-i18next version
“next-i18next”: “^10.2.0” “@trpc/next”: “^9.18.0”
Steps to reproduce
export default withTRPC<AppRouter>({
config({ ctx }) {
let url = process.env.TRPC_URL!
return { url }
},
ssr: true, // // no error when set to false
})(appWithTranslation(MyApp))
Expected behaviour
It should also work with tRPC.
OS (please complete the following information)
- Device: Gitpod Cloud (but also tested locally)
- Browser: Chrome
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
next-i18next not working correctly with wrapped tRPC ... - GitHub
Describe the bug When wrapping an app with withTRPC that is already wrapped with appWithTranslation leads to the error react-i18next:: You ...
Read more >i18n support is not compatible with next export. (SSR - NextJS ...
Digging through issues on vercel's github I found this alternative that doesn't use next-i18next or any other nextjs magic:.
Read more >Next.js internationalization (i18n) tutorial - Localizely
js apps is the inability to export to static HTML. Running such command results in "Error: i18n support is not compatible with next...
Read more >sitemap-posts.xml - React.js Examples
... 0.8 https://reactjsexample.com/solid-the-right-way-to-write-react-clean-code/ ... -issues-and-alerting-users-suggesting-changes-to-deployment-yamls/ ...
Read more >Bookmarks - Software Engineer - Simone Corsi
gsklee/ngStorage - localStorage and sessionStorage done right for AngularJS. ... Please do not create issues or send pull requests.
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
@KATT You are absolutely right. That is the same problem. I will disable the tRPC SSR feature for now, too. I also voted the Next.js issue up. A little hint in the docs would be cool. Otherwise a superb library!!!
This issue has been locked because it had no new activity for 14 days. If you are running into a similar issue, please create a new issue. Thank you.