nextjs - 💡(How to fix) Fix New Next.js Projekt strange Build fails [3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#84296Fetched 2026-04-08 02:20:00
View on GitHub
Comments
3
Participants
4
Timeline
7
Reactions
0
Timeline (top)
commented ×3closed ×1issue_type_added ×1labeled ×1

Error Message

[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.] 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.] Export encountered an error on /_error: /404, exiting the build. ⨯ Next.js build worker exited with code: 1 and signal: null

Code Example

[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.]
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.]
Export encountered an error on /_error: /404, exiting the build.
  Next.js build worker exited with code: 1 and signal: null

---

Platform: linux
  Arch: x64
  Version: #84-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep  5 22:36:38 UTC 2025
  Available memory (MB): 64076
  Available CPU cores: 20
Binaries:
  Node: 22.19.0
  npm: 11.4.2
  Yarn: 1.22.19
  pnpm: N/A
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.9.2
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/HONK2006-dev/Tennsitastic.git

To Reproduce

Just try to build it with next build in apps/docs or try it with turbo build

Current vs. Expected behavior

I have a created a new repo with nextjs and turborepo. The next dev compiles without any error but if i try to build it it get the 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.] 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.] Export encountered an error on /_error: /404, exiting the build. ⨯ Next.js build worker exited with code: 1 and signal: null


### Provide environment information

```bash
Platform: linux
  Arch: x64
  Version: #84-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep  5 22:36:38 UTC 2025
  Available memory (MB): 64076
  Available CPU cores: 20
Binaries:
  Node: 22.19.0
  npm: 11.4.2
  Yarn: 1.22.19
  pnpm: N/A
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.9.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

build, turbopack

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

I have also tested it on my macbook pro m4 max wiht macos 15.7 and it is the same error

extent analysis

TL;DR

  • The most likely fix is to identify and resolve the issue causing the React error #31, which is occurring during the prerendering of pages.

Guidance

  • Verify the error by checking the non-minified dev environment for full errors and additional warnings, as suggested in the error message.
  • Investigate the /404 and /500 pages to ensure they are correctly implemented and do not contain any errors that could be causing the prerendering issue.
  • Check the Next.js documentation on prerendering errors for more information and potential solutions.
  • Consider testing the build process with a minimal reproduction of the issue to isolate the cause.

Example

  • No specific code snippet can be provided without more information, but checking the pages mentioned in the error (e.g., /404, /500) for any potential issues is a good starting point.

Notes

  • The error message suggests using the non-minified dev environment for more detailed error information, which could help in identifying the root cause.
  • The issue seems to be related to the prerendering process in Next.js, specifically with the React error #31.

Recommendation

  • Apply workaround: Identify and fix the root cause of the React error #31, which is likely related to the implementation of the /404 or /500 pages or their components.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING