To reproduce this error:
- Run
npm preview
in one tab. - In the next tab
npm run break
(may need to run a couple of times if you observe no errors) - Observe
TypeError: Cannot read properties of null (reading 'useContext')
in the logs + 500 internal server error
To show the error is fixed (requires Node.js v22+):
- Run
npm preview:fixed
in one tab. - In the next tab
npm run break
- Observe both requests succeed