-
-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not support Pages router with Next.js < 13 #1282
Comments
Hey @sraka1, many thanks for the report! There was an oversight here on my side indeed. While all of the Pages Router-compatible APIs from However, Next.js <13 uses the CommonJS entry of The good news is that Next.js 10–12 is still fully supported, but you have to import from I've just added a corresponding section to the docs: Support for legacy Next.js versions. There's also a working example referenced in the section. Can you have a look if this works for you? In the next major version I'll have to adjust the peer dependency version of |
@amannn excellent, thanks for the explanation. In the meanwhile I reverted to version @2, which seems to also work fine for now. :) Also, separately, a couple more things:
AFAIK, this is only executed once per request server-side and thus the messages are loaded (and injected into the DOM) at that time. I really don't want to do Sorry for the long write-up. Nice library, thanks for your work 👍 |
Sure, that's fine! In regard to your other comments:
Definitely ok from my perspective!
I think what you're looking for is shown in the App Router migration example. Maybe that helps?
There are existing discussions like #723, does that help? Reloading the page should not be the case (at least with App Router), but Next.js has to re-mount the page. I'm going to close this issue as the original question has been resolved. Hope you can get your project off the ground successfully! 🙌 |
Description
In the CHANGELOG https://next-intl-docs.vercel.app/blog/next-intl-3-0 you explicitly mention
This also coincides with the peerDeps in the package.json (Next >= 10)
https://next-intl-docs.vercel.app/docs/getting-started/pages-router
However, following the Pages router guide and importing NextIntlClientProvider generates the following issue.
It seems that either support for Next.js <= 12 was dropped (since next/navigation was introduced with Next 13) or the docs need to be updated to reflect that they are for Next >= 13 and additional docs provided for Next <= 12.
Verifications
Mandatory reproduction URL
https://github.com/sraka1/next-intl/tree/main/examples/example-pages-router
Reproduction description
Steps to reproduce:
next dev
Expected behaviour
No error on
next dev
Additional note
Please, please, please, don't "resolve" this issue by dropping support for Next <= 12. A considerable percentage (I'd even say a vast majority) of projects are still bound to <=12.
The text was updated successfully, but these errors were encountered: