question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

next-i18next not working correctly with wrapped tRPC when SSR is enabled

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
medihackcommented, Feb 12, 2022

@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!!!

0reactions
github-actions[bot]commented, Oct 4, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found