1) npx create-next-app@canary
2) pnpm i -g next@latest
3) restart terminal
4) run next build in root of project
Current vs. Expected behavior
As next build is using the same version of next, it should pass the build the same as pnpm build did
Provide environment information
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64
Available memory (MB): 32768
Available CPU cores: 8
Binaries:
Node: 20.12.2
npm: 10.5.0
Yarn: 1.22.22
pnpm: 8.14.0
Relevant Packages:
next: 15.0.2-canary.6 // Latest available version is detected (15.0.2-canary.6).
eslint-config-next: 15.0.2-canary.6
react: 19.0.0-rc-1631855f-20241023
react-dom: 19.0.0-rc-1631855f-20241023
typescript: 5.6.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
user@MacBook---MacBook-Pro test-app % next build
▲ Next.js 15.0.2-canary.6
Creating an optimized production build ...
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Collecting page data
Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20ref%2C%20props%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:490)
at Xc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:409)
at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:210)
at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
at $c (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
at bd (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217)
at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479)
Error occurred prerendering page "/404". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20ref%2C%20props%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:490)
at Xc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:409)
at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:210)
at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
at $c (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
at bd (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217)
at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479)
Export encountered an error on /_error: /404, exiting the build.
⨯ Static worker exited with code: 1 and signal: null
user@MacBook---MacBook-Pro test-app % next -v
Next.js v15.0.2-canary.6
user@MacBook---MacBook-Pro test-app % pnpm build
test-app@0.1.0 build /Users/user/projects/test-app
next build
▲ Next.js 15.0.2-canary.6
Creating an optimized production build ...
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Collecting page data
✓ Generating static pages (5/5)
✓ Collecting build traces
✓ Finalizing page optimization
Route (app) Size First Load JS
┌ ○ / 5.46 kB 105 kB
└ ○ /_not-found 897 B 101 kB
First Load JS shared by all 99.7 kB
├ chunks/215-bf068c40b28aa040.js 45.2 kB
├ chunks/4bd1b696-13ded8ebc139027f.js 52.6 kB
└ other shared chunks (total) 1.88 kB
Link to the code that reproduces this issue
https://github.com/Seva98/test-app
To Reproduce
1) npx create-next-app@canary 2) pnpm i -g next@latest 3) restart terminal 4) run
next build
in root of projectCurrent vs. Expected behavior
As
next build
is using the same version of next, it should pass the build the same aspnpm build
didProvide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
user@MacBook---MacBook-Pro test-app % next build ▲ Next.js 15.0.2-canary.6
Creating an optimized production build ... ✓ Compiled successfully ✓ Linting and checking validity of types
✓ Collecting page data
Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20ref%2C%20props%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings. at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:490) at Xc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:409) at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:210) at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89) at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481) at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89) at $c (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98) at bd (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404) at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217) at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479) Error occurred prerendering page "/404". Read more: https://nextjs.org/docs/messages/prerender-error Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20ref%2C%20props%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings. at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:490) at Xc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:409) at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:210) at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89) at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481) at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89) at $c (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98) at bd (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404) at Z (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217) at Zc (/Users/user/Library/pnpm/global/5/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479) Export encountered an error on /_error: /404, exiting the build. ⨯ Static worker exited with code: 1 and signal: null user@MacBook---MacBook-Pro test-app % next -v Next.js v15.0.2-canary.6 user@MacBook---MacBook-Pro test-app % pnpm build
▲ Next.js 15.0.2-canary.6
Creating an optimized production build ... ✓ Compiled successfully ✓ Linting and checking validity of types
✓ Collecting page data
✓ Generating static pages (5/5) ✓ Collecting build traces
✓ Finalizing page optimization
Route (app) Size First Load JS ┌ ○ / 5.46 kB 105 kB └ ○ /_not-found 897 B 101 kB
○ (Static) prerendered as static content