Getting errors when tried to use useTranslations within client component #976
Unanswered
tnkshuuhei
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use next-intl within client component. then getting these errors
directory structure
At first, I got this error when I try to use useTranslations within client components.
This can happen because:
You intended to render this component as a Server Component, the render
failed, and therefore React attempted to render the component on the client
instead. If this is the case, check the console for server errors.
You intended to render this component on the client side, but no context was found.
Learn more about this error here: https://next-intl-docs.vercel.app/docs/environments/server-client-components#missing-context
then I tried to to wrap children with NextIntlClientProvider but getting error
app/[locale]/layout.tsx
app/middleware.ts
app/i18n.ts
./next.config.js
Beta Was this translation helpful? Give feedback.
All reactions