Issue with Context in Next.js Using next-intl: Context Not Found #816
Unanswered
grozamagustov
asked this question in
Q&A
Replies: 1 comment
-
I think this is happening because of the getLayout function on my page, removing it everything works well. This is the login page and I am removing the default layout DesktopLogin.getLayout = function getLayout(page: ReactElement) { |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My project is structured as follows:
The specific error message I receive in server console is:
Error: Failed to call
useTranslations
because the context fromNextIntlClientProvider
was not found.Ensured that NextIntlClientProvider is correctly wrapped around my app in _app.tsx.
Checked for any potential issues with the way useTranslations is invoked in the DesktopAuthPage component.
Verified that localization files are correctly set up and loaded.
Added additional logging to trace the rendering process and context availability.
This issue seems to occur specifically during the build process, particularly during the prerendering phase. It's unclear why the context provided by NextIntlClientProvider is not being recognized in the DesktopAuthPage component despite seemingly correct setup.
I would greatly appreciate any advice or insights into this issue. Has anyone else encountered this problem, or does anyone have suggestions on what might be causing this and how to resolve it?
Thank you for your time and assistance.
Beta Was this translation helpful? Give feedback.
All reactions