You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read properties of null (reading 'useContext') at p (...\.next\server\pages\_error.js:19:2590) Error occurred prerendering page "/404". Read more: https://nextjs.org/docs/messages/prerender-error Export encountered an error on /_error: /404, exiting the build. ⨯ Next.js build worker exited with code: 1 and signal: null
Current vs. Expected behavior
next build should complete successfully and statically export all pages including /404 and /_error.
Actual:
Build fails with a runtime error during prerendering.
Provide environment information
Operating System: Windows 11 64-bit
Node.js Version: 20.12.2
npm Version: 10.5.0
Package Manager: npm
Next.js Version: 15.4.5
Hosting: Local
Which area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
Suspected root cause: useContext called on null during _error.js or /404 rendering in static export
auto-install-peers warning likely unrelated, but present
I tested disabling the _error.tsx file, and build succeeds
Disabling "output": "standalone" does not fix the issue