Link to the code that reproduces this issue
https://github.com/official-MKV/test-reproduction
To Reproduce
- npm install
- next build
Current vs. Expected behavior
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useContext')
Export encountered errors on following paths:
/_error: /404
/_error: /500
/_not-found
/favicon.ico/route: /favicon.ico
/page: /
Provide environment information
operating system: windows
node version: v20.9.0
next version: 14.2.5
react version: @18.3.1
Which area(s) are affected? (Select all that apply)
Webpack
Which stage(s) are affected? (Select all that apply)
next build (local), Vercel (Deployed)
Additional context
I noticed the error on one of my previous projects after trying to next build, I searched for a solution online, went through everything, there is already an existing issue with this same title, but it was never closed and a conclusive solution was never given.
- I deleted my
package.json, node_modules, cleared cache and re-installed
- I slimmed down my dependencies
- I set NODE_ENV=production, saw this solution on youtube
- I decided to start all over no dependency, no code, and run
next build and the error was till there
Link to the code that reproduces this issue
https://github.com/official-MKV/test-reproduction
To Reproduce
Current vs. Expected behavior
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useContext')
Provide environment information
Which area(s) are affected? (Select all that apply)
Webpack
Which stage(s) are affected? (Select all that apply)
next build (local), Vercel (Deployed)
Additional context
I noticed the error on one of my previous projects after trying to
next build, I searched for a solution online, went through everything, there is already an existing issue with this same title, but it was never closed and a conclusive solution was never given.package.json,node_modules, cleared cache and re-installednext buildand the error was till there