After just setting up next.js for my upcoming website, I ran into some unexpected errors while trying to host it with "next". The specific error message I encountered was:
TypeError: Cannot read properties of null (reading 'useContext')
This issue occurred during the page generation process. Any relevant console logs can be found in the terminal window.
Call Stack
Object.useContext
file:///C:/Users/sakura/Documents/hosting/node_modules/react/cjs/react.development.js(1618:21)
Html
..\..\AppData\Roaming\npm\node_modules\next\dist\pages\_document.js(685:105)
renderWithHooks
file:///C:/Users/sakura/AppData/Roaming/npm/node_modules/next/node_modules/react-dom/cjs/react-dom-server.browser.development.js(5658:16)
...
I'm not certain if this is a common occurrence when initially compiling a website using next.js or if it's an isolated incident.
My expectation was that following compilation, the website would display as intended, similar to how a regular react site functions. However, instead of seeing the desired output, an error was returned.