Next.js Discord

Discord Forum

TS React with i18Next

Unanswered
Asian paper wasp posted this in #help-forum
Open in Discord
Avatar
Asian paper waspOP
We've got a Next project with TS setup. Now, we're are a stage where we need to add other languages. I've tried to setup the package, and it seemed to be working until I actually try to use the i18next.t() method or the Trans component. Keep getting an import error and I'm not sure why.

For context, this app is being converted from an old React JSX app, to the latest Next TSX app.

Any ideas on what to look for to fix this?

Package Ref:
https://react.i18next.com/

Note:
We are using CLASS COMPONENTS.

6 Replies

Avatar
Asian paper waspOP
Server Error

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Avatar
Asian paper waspOP
Still stuck on this.
Avatar
Asian paper waspOP
Haven't found a solution for how to get Next.js working with translations.
Avatar
Asian paper waspOP
Been working on nothing but this since yesterday trying to get this to work, including react-i18next and next-i18next packages.
Avatar
Asian paper waspOP
Anyone have any ideas? Still broken.
Avatar
Asian paper waspOP
Got it worked out finally.