Next.js Discord

Discord Forum

Pre-rendering error page error on build?

Unanswered
Australian Freshwater Crocodile posted this in #help-forum
Open in Discord
Australian Freshwater CrocodileOP
#15 26.45 @***/web:build:    Generating static pages (0/4) ...
#15 26.91 @***/web:build: TypeError: Cannot read properties of null (reading 'useContext')
#15 26.91 @***/web:build:     at p (.next/server/pages/_error.js:19:7026)
#15 26.91 @***/web:build: Error occurred prerendering page "/404". Read more: https://nextjs.org/docs/messages/prerender-error
#15 26.91 @***/web:build: TypeError: Cannot read properties of null (reading 'useContext')
#15 26.91 @***/web:build:     at p (.next/server/pages/_error.js:19:7026)
#15 26.91 @***/web:build: Export encountered an error on /_error: /404, exiting the build.
#15 26.93 @***/web:build:  ⨯ Next.js build worker exited with code: 1 and signal: null
#15 26.99 @***/web:build: error: script "build" exited with code 1
#15 27.00 @***/web:build: ERROR: command finished with error: command (/app/apps/web) /usr/local/bin/bun run build exited (1)
#15 27.00 @***/web#build: command (/app/apps/web) /usr/local/bin/bun run build exited (1)



Can’t get my head around this. Seems like I’ve done no big changes to cause this, somewhat just happened. Maybe a dependency upgrade. Let me know if you need more context. This was on build. I don’t use the pages router. No errors in dev.

2 Replies

West African Crocodile
I'm having this after creating a brand new project!!! Did you figure this out @Australian Freshwater Crocodile?