Minified React error #31 after upgrading to Next 15 #73761
Replies: 9 comments 19 replies
-
I was getting this yesterday, when I tried to build someone else's project. Upgrading to |
Beta Was this translation helpful? Give feedback.
-
My new Next.js 15 project is located in a monorepo. After moving it out and building it separately, it worked fine. |
Beta Was this translation helpful? Give feedback.
-
Try removing The way I tested this:
|
Beta Was this translation helpful? Give feedback.
-
Just to report back, it was this repository, https://github.com/eknkc/ssr-benchmark, that when upgrading to Next 15, the root, and |
Beta Was this translation helpful? Give feedback.
-
I'm encountering this error again. For a while, the error didn't occur, but now it's back. I tried deleting the node_modules folder and reinstalling everything, but it didn't help. I'm using Next.js version 15. What’s strange is that 20 commits ago, I was building the project without any issues on each commit, but now the error appears on every commit. Any ideas on what might be causing this? |
Beta Was this translation helpful? Give feedback.
-
I'm having this issue when trying to build a fresh nextjs app in a monorepo (using bun workspaces, but I tried a vanilla npm workspace as well). Downgraded to 14.2.24, which works. |
Beta Was this translation helpful? Give feedback.
-
For those who don't want to downgrade next or react, and don't use the pages router, and are only getting this error prerendering page "/404" and "/500", this error is coming from Specially, here: next.js/packages/next/src/export/routes/pages.ts Lines 114 to 126 in b8ee3ce So I just patched this file by commenting out the following line: And I get a successful build. If you're ok with having empty "/404" and "/500" pages and don't mind potential pitfalls of having mixed React versions, you can try doing the same. |
Beta Was this translation helpful? Give feedback.
-
Quick Fix: Consistent React Version for Next.js 15Next.js 15 requires React 19+ in each workspace to prevent the “Minified React error #31”. Follow these steps to fix your build: 1. Update React DependenciesIn each workspace package "react": "^19.0.0",
"react-dom": "^19.0.0" 2. Clean Existing Modules, Cache & Build Folders2.1 Remove root
|
Beta Was this translation helpful? Give feedback.
-
I ran into the same issue when upgrading to Next.js 15 (15.3.2) in my Turborepo project. Even after upgrading all packages to support React 19 I was still having the issue in both local and CI builds. I noticed that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
After running
npx @next/codemod@canary upgrade latest
to upgrade from Next 14 to 15, I can't build my project withnext build
:The closest things to an hint I can get from this is a mention of a "/404" page, which I do not have in my project. What should I do?
Additional information
Beta Was this translation helpful? Give feedback.
All reactions