-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
meta: upgrade to next.js 16 #8218
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8218 +/- ##
==========================================
- Coverage 76.40% 75.01% -1.39%
==========================================
Files 115 115
Lines 9643 9643
Branches 317 311 -6
==========================================
- Hits 7368 7234 -134
- Misses 2274 2408 +134
Partials 1 1 ☔ View full report in Codecov by Sentry. |
cc @styfle any idea what the prod build failing could be? Pretty much using standard error pages 🤔 |
Hi, I haven't fully sorted this out, but I managed to get a "bad" passing build. This was my only attempt and the order of steps was a bit chaotic, so not as linearly as presented here. I used the With that flag I started to see: Error occurred prerendering page "/_not-found". Read more: https://nextjs.org/docs/messages/prerender-error
@node-core/website:build: Error:
@node-core/website:build: at WithNavBar (turbopack:///[project]/apps/site/components/withNavBar.tsx:43:31)
@node-core/website:build: 41 | const { resolvedTheme, setTheme } = useTheme();
@node-core/website:build: 42 | const { replace } = useRouter();
@node-core/website:build: > 43 | const pathname = usePathname();
@node-core/website:build: | ^ All of the errors reported, pointed at the group of
After replacing the helpers with their const websitePages = await getMarkdownFiles(
process.cwd(),
`_pages/${defaultLocale.code}`
); With all of that... ![]() I think the path generation is somehow causing all of these to error. At this point, I do not think that we need to change Also I am not familiar enough with this repo, so maybe I am building with the wrong Note that https://github.com/amannn/next-intl/tree/main/examples/example-app-router w/ next@beta builds without errors too. Hopefully this gives you some insight. Happy to keep on helping! |
Sounds like a bug on Next.js imo
Could be that |
Most likely a Next.js thing yeah ~ I'll try to set some time apart later, to try and build by bisecting canaries. |
Hey @ovflowd, thanks for pinging me! So yes, as @icyJoseph mentioned, the examples in the The only change I found in Next.js 16 beta that broke something for me was related to parallel routes (see vercel/next.js#84738), but a potential solution was discussed in that thread. I'll make a note to take a closer look at this PR tomorrow, maybe I can spot something! I'll keep you posted. |
Hello again! Could someone verify this, I've been doing some canary bisecting and such, and figured out a couple of things. Building with Building with Edit: I am confident I've found the source of the bug, I just don't understand |
@amannn sorry for the tag mate, but the mystery is nearly solved. The If we can sort this one out, then |
Got the solution :)
Then |
We are always happy to bug test dependencies 😃, betas are important! Thank you! |
Weird thing is Turbopack builds were working with Next.js 15 🤔 |
I also found something interesting when creating a
Something is clearly bugged/borked on Next.js |
Right, in one of the canaries going up to v16, a Turbopack optimization was introduced, where some Pages Router assets are no longer generated, if there's no Pages Router code. How "no Pages Router code" is calculated has a bad branch. Hopefully a patch will be out soon 🙏 |
I was able to make it work with a very interesting work around. Creating a 404.tsx and 500.tsx, which kinda explains what you just said. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades the Next.js framework from version 15.5.4 to 16.0.0-beta.0, bringing support for React 19 and introducing the React Compiler. The upgrade includes configuration changes to support new features and fixes for build issues.
Key changes:
- Upgraded Next.js to version 16.0.0-beta.0 with React Compiler enabled
- Added placeholder error pages (404.tsx and 500.tsx) and updated error handling components
- Migrated from Turbo to Turbopack for build optimization and updated TypeScript JSX configuration
Reviewed Changes
Copilot reviewed 13 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pnpm-workspace.yaml | Updated @types/react version for React 19 compatibility |
package.json | Updated cross-env and globals dependencies |
apps/site/tsconfig.json | Changed JSX transform and added dev types path |
apps/site/pages/500.tsx | Added placeholder 500 error page |
apps/site/pages/404.tsx | Added placeholder 404 error page |
apps/site/package.json | Upgraded Next.js and related packages, added React Compiler |
apps/site/next.config.mjs | Enabled React Compiler and Turbopack configurations |
apps/site/mdx/plugins.mjs | Optimized Shiki plugin as singleton for performance |
apps/site/eslint.config.js | Updated ESLint Next.js configuration format |
apps/site/app/global-error.tsx | Removed global error page component |
apps/site/app/[locale]/not-found.tsx | Converted to server component and simplified UI |
apps/site/app/[locale]/error.tsx | Simplified error page UI and removed arrow icon |
.prettierignore | Added next-env.d.ts to ignore list |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Lighthouse Results
|
(Although this is just a workaround and it also creates a /500 and /404 route that are empty pages LOL) |
But yeah a bug fix on upstream would be much appreciated. Apologies for the false alarm, @amannn 🙈 |
Aaand of course Playwright with Cloudflare failed. |
Much crazier bug, although that could be just OpenNext not being compatible with Next.js 16 yet |
@icyJoseph Thanks for getting to the bottom of this! That sounds right to me that you'd have to add another provider instance since |
Mmm has this been deployed with Turbopack builds before? I found this issue over at OpenNext opennextjs/opennextjs-cloudflare#569 requesting support for Turbopack 🤔 |
Yes, we use Vercel for deployment and have relied on Turbo for a long time. Our main friction point is the stability of Turbo during Next.js major version upgrades, which consistently necessitates assistance from the Vercel team. We hope to see increased stability in this area—perhaps through the inclusion of more diverse, long-running use cases in Turbopack’s testing regimen. We also ensure broad compatibility by building for OpenNext. |
It seems you're misunderstanding where this breaks. It's not in Next.js, it's because Cloudflare uses a custom runtime that is not Node.js (surprised that the Node.js website is not using Node.js). We've worked with the OpenNext team, including other providers to fully support them and are collaborating with all providers on Adapters: https://nextjs.org/blog/next-16-beta#build-adapters-api-alpha. I.e. I opened a PR to make it fully work on Netlify: opennextjs/opennextjs-netlify#2987. |
I think there might be a bit of a misunderstanding here. The Cloudflare build failures don’t seem related to the issue we’re discussing in this PR — that one appears to be on the Next.js side (at least based on what @icyJoseph mentioned). Not pointing fingers here, just trying to get early builds of our website running smoothly on the edge. So far, we’ve had great collaboration with the Vercel team in getting things working.
We actually do! The website is deployed on Vercel, which, as far as I understand, runs on Node.js — right? The Cloudflare builds with OpenNext are a fallback.
That’s awesome :) |
I also just realised that ChatGPT rephrased this with tons of gibbrish 😅 -- What I was trying to convey is that often when upgrading to newer versions of Next.js we find bugs that break the build, which is completely expected. These are BETA/Canaries and we're more than happy to collaborate (and fortunate enough) that the Vercel team is here supporting us ❤️ The gist of my message regarding Turbopack stability was to question whether more tests could be added on the Turbopack test suite that covers situations such as the one we faced. It could also be that our use case is just too niche, which is fair enough. Apologies, only realized hours after posting my comment that the rephrasing actually was much worse than my original message. |
This PR is a draft PR for upgrading to Next.js 16.