-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Support for Next.js 15 RC and React 19 RC #1075
Comments
Hmm, that's interesting. The Next.js 15 release is scheduled for next week as far as I know, maybe worth waiting until then. It might be that they're still ironing out some details. Once Next.js 15 is out, I'll open a PR to update all examples and will make sure everything works as expected. |
@amannn I see, thanks. Just as and added note, this morning I tried with my company app (where I first faced this issue) and tried the setup without i18n routing. It did work with Webpack but once I tried with Turbopack it threw the same error described above. The app uses some other dependencies than the reproduction provided here: shadcn ui (Tailwind + Radix) and Authjs v5 beta are the only difference on the frontend part (it has some server side dependencies that I believe shouldn't affect anything with react). |
can confirm this issue. |
Able to reproduce it here as well. |
Hi, I just tried to update to Next.js 15 RC and it crashes with:
|
This is the error I got:
|
I've just upgraded two examples in #1089 to Next.js 15 RC and React 19 RC. Generally this seems to work, but it looks like the issue you are seeing comes from vercel/next.js#65424. Currently in the docs we suggest to import i18n config from For the time being you can fix this by making sure you're not importing anything from the navigation module into the middleware (see b746959). I've asked the Next.js team for clarification if we should adjust the docs here. |
Side note for those living on the bleeding edge: The test suite from |
Cheers, moved them to a separate file for now, works excellently! |
Thanks, that is clearly the issue. I have made the change on my reproduction with i18n navigation and it works. Funny enough, I checked on my company app and noticed that in there I had already separated in two files the locales configuration and the navigation, and never imported navigation to the middleware. So it shouldn't have failed....unless the issue is somewhere else. Well, turns out Auth.js v5 has the same issue. My reproduction uses v4 as that is the same from next-intl examples. I tested to upgrade to v5 and voilà, again the same error. I suppose I will have to open an issue on next-auth now 😅 Thanks again @amannn for finding the root of the issue. |
I've been pointed out here latest Next canary includes this fix that resolves all these issues caused by vercel/next.js#65424 |
@makoveckib Yep, I've written a detailed analysis about this in #1375 and a canary release is already available with the relevant changes if someone wants to test it: #1391. |
"next-intl": "^3.21.0-canary.0", |
There’s some minimal migration necessary if you want to get rid of the warnings, please refer to the linked PRs in the release PR. |
I just gave Next.js 15 RC 2 a shot, and while some things have improved, it seems like there is still a bug on their end: vercel/next.js#69000 (comment). So be careful if you decide to upgrade to it. Apart from that, be careful when running the codemod for transforming pages that access Before: export default function Page(props) {
const searchParams = props.searchParams;
const t = useTranslations('Page')
// ...
} Broken after codemod: export default async function Page(props) {
const searchParams = await props.searchParams;
const t = useTranslations('Page')
// ...
} Fixed: import {use} from 'react';
// (no async)
export default function Page(props) {
const searchParams = use(props.searchParams);
const t = useTranslations('Page')
// ...
} See also the notes in vercel/next.js#68812. The recently released |
Thanks for your efforts, @amannn? If we want to make the switch, should we use the latest canary on npm |
@wottpal Yep, that's the latest one! If you install Regarding |
Ty! Got everything running smoothly on v15 🚀 |
Update: I'll wait with updating docs and examples for Next.js 15 for the time being since there's a critical bug in Next.js 15 that affects multilingual apps that use i18n routing. However, I've added a separate PR that merely bumps the peer dependency: #1443. If you don't use i18n routing or don't rely on alternate links, you can consider updating already. |
hi @amannn! Thanks for your great job on all this stuff and a question on your last mention above, regarding "...there's a critical bug in Next.js 15...": Are the docs updated now, or are we still waiting for the solution on this bug? Or more precise :) |
next-intl can surely be updated to the latest version, I only found that Next.js 15 has a bug with alternate links (see above). Additionally, I found this one the other day: vercel/next.js#71623. That’s not really related to next-intl though, rather a general bug and might not affect your app. I’ll update the examples and docs in this repo once the bug with alternate links is fixed. |
Description
I have taken the example code from
example-app-router-next-auth
that has the With i18n Routing setup; and tried to use latest Next canary (18.3.0-canary.70 at the time of writing this) with React 19 RC in order to test both that and the new React compiler.There seems to be an issue with React 19, as the application fails to run, even without trying the React compiler.
Without turbo it shows the following error.
With turbo, instead shows this error.
I have made another branch where I have follow the documentation for
Without i18n routing
. This removes the[locale]
,navigation.ts
and use of next-intl middleware onmiddleware.ts
. With these changes the application runs perfectly fine both with/without turbo and the react compiler.Verifications
Mandatory reproduction URL
https://github.com/Aralf/next-intl-react-19-compiler
Reproduction description
Steps to reproduce:
next dev
with or without turbowithout-i18n-routing
next dev
with or without turboExpected behaviour
It should work for both the With i18n routing and the Without i18n routing setups.
The text was updated successfully, but these errors were encountered: