You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At first, I followed the tutorial exactly as written and encountered the following error:
Error: Failed to call `useTranslations` because the context from `NextIntlClientProvider` was not found.
Then, I found an example of "proper implementation", but it resulted in the same error as above. Moreover, it confused me even more because I found an issue stating that we should avoid using unstable_setRequestLocale.
I added NextIntlClientProvider however, when I call useMessages(), I get a 404 error.
In summary, no matter where I use useTranslations or useMessages, I always encounter an error. I'm confused.
Static rendering should not be implemented via force-static (please see the corresponding docs). Furthermore, unstable_setRequestLocale should be called before you call hooks like useMessages or useTranslations (see the corresponding docs).
There's unfortunately a bit of config involved to get static rendering working correctly, but hopefully we can get rid of this in the future.
If case you don't need static rendering, you can also avoid this API.
Description
Then, I found an example of "proper implementation", but it resulted in the same error as above. Moreover, it confused me even more because I found an issue stating that we should avoid using
unstable_setRequestLocale
.I added
NextIntlClientProvider
however, when I calluseMessages()
, I get a 404 error.In summary, no matter where I use
useTranslations
oruseMessages
, I always encounter an error. I'm confused.Mandatory reproduction URL
https://github.com/test-examples/next-intl
The text was updated successfully, but these errors were encountered: