next-i18next icon indicating copy to clipboard operation
next-i18next copied to clipboard

Incompatible with Next 12.2

Open NicolasBonet opened this issue 2 years ago • 8 comments

Describe the bug

When I upgrade to Next 12.2 and deploy to Vercel, I have the following error:

Cannot read properties of undefined (reading '_nextI18Next')

It gets resolved as soon as I downgrade to [email protected]

Occurs in next-i18next version

11.0.0

Steps to reproduce

Just upgrade to [email protected] and then try to access to the app, in my case I get a black screen (screenshot attached).

Expected behaviour

The page should work just like it did for [email protected]

Screenshots

image

Additional Info

I'm sure I'm using serverSideTranslations inside the page that I'm trying to load.

NicolasBonet avatar Jul 01 '22 16:07 NicolasBonet

If it works locally, have you opened an issue at next ?

adrai avatar Jul 06 '22 10:07 adrai

I'm experiencing the same issue . I also noticed that the problem might be somehow linked to Incremental Static Regeneration : the problem vanishes after a new build and re-appear after 15 min (my page's cache is supposed to revalidate after 15 min). But I have ISR on 3 others pages with i18n-next which don't have any bug. I also linted all my .yaml looking for a special character and I didn't found anything.

"next": "^12.2.0"
"next-i18next": "^11.0.0"
"react": "^18.2.0"
"react-dom": "^18.2.0"

ismaelbks avatar Jul 11 '22 17:07 ismaelbks

Cannot read properties of undefined (reading '_nextI18Next')

I upgraded to nextjs 12.2 and I also have the same error using next-i18next 8.9.0

I just upgrade next-i18next to 11.0.0 to see if corected

pmcflepage avatar Jul 11 '22 20:07 pmcflepage

We have the same problem, and its somehow related to the middleware were using. Even if the middleware is just using a single next(). If there is no file, it just works fine.

Tried the next canary versions of next though and the error goes away, but with middleware there are still some strange behavior. For now the solution was rolling back the next version.

visualcohol avatar Jul 11 '22 20:07 visualcohol

I have a similar issue with a custom middleware (for basic auth) and automatic locale redirects causing infinite redirects and at some point the website crashing because of it.

This is definitely a nextjs error, planning to set up a repro case soon

maggo avatar Jul 14 '22 15:07 maggo

Same issue here with:

Was working well in the 12.2.beta, as far as I remember.

What is the status ? Has anyone raised an issue on Next ?

AAS97 avatar Jul 27 '22 10:07 AAS97

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 12 '22 00:08 stale[bot]

Not stale.

JCMais avatar Aug 12 '22 01:08 JCMais

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 09 '22 00:09 stale[bot]

#1657 same error message other reason?

adrai avatar Sep 09 '22 18:09 adrai

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 22 '22 02:09 stale[bot]

FYI: We had the same issue but we managed to fix it by removing getInitialProps in the custom App. We also have a custom middleware with redirects which was not the issue for us

next: 12.1.4 next-i18next: ^12.1.0

mavridiSS avatar Oct 06 '22 07:10 mavridiSS

Same issue with: next: 12.2.0, next-i18next: 12.1.0

typeError: Cannot read properties of undefined (reading '_nextI18Next')

thirdmusketeer avatar Dec 06 '22 11:12 thirdmusketeer

Same issue with

next: 12.2.0, next-i18next: 12.1.0

please provide a minimal reproducible example... seems to work here: https://github.com/i18next/next-i18next/tree/master/examples/simple

adrai avatar Dec 06 '22 11:12 adrai

Same issue with next: 12.2.0, next-i18next: 12.1.0

please provide a minimal reproducible example... seems to work here: https://github.com/i18next/next-i18next/tree/master/examples/simple

It's not always reproducible, happening randomly while navigating between different routes. Using getServerSideProps

thirdmusketeer avatar Dec 06 '22 11:12 thirdmusketeer

can #ignore Root cause for the issue in my case https://github.com/vercel/next.js/discussions/14726

thirdmusketeer avatar Dec 07 '22 11:12 thirdmusketeer