useTranslations
no longer working in client components on Next 15
#1468
Unanswered
nekode-dev
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hey @nekode-dev, that seems odd to me—I didn't have any such issues in my tests with Next.js 15. Can you by chance share a reproduction? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there,
Since the migration over to app router last year, we took the approach of passing all messages to the client side through the
NextIntlClientProvider
as outlined in the docs here. With this approach, we were able to calluseTranslations
directly within any component marked with'use client'
, as well as all components rendered on the server.However, since upgrading to Next 15 we are now met with the
”Failed to call useTranslations because the context from NextIntlClientProvider was not found.”
exception outlined in the docs here. We have tried following the suggestions highlighted in the docs, but we can only really see a way forward by prop drilling all of our translations through to our client components from server components, which seems extremely cumbersome.I can't find any documentation updates that specify
useTranslations
will no longer work in client components, so is this now intended behaviour or a mistake?Thanks in advance,
Tom
Beta Was this translation helpful? Give feedback.
All reactions