Error running documentation on PC

I tried to open the documentation locally on the machine. I have Node installed.js v18.16.0 (then did as it says on the page):

In this case, we get the error:

error - TypeError: Cannot read properties of null (reading 'useContext')
    at Object.useContext (C:\GDev\babylon-js\docs\node_modules\react\cjs\react.development.js:1618:21)
    at StylesProvider (C:\GDev\babylon-js\docs\node_modules\@mui\styles\node\StylesProvider\StylesProvider.js:52:30)
    at renderWithHooks (c:\GDev\babylon-js\docs\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5658:16)
    at renderIndeterminateComponent (c:\GDev\babylon-js\docs\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5731:15)
    at renderElement (c:\GDev\babylon-js\docs\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5946:7)
    at renderNodeDestructiveImpl (c:\GDev\babylon-js\docs\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6104:11)
    at renderNodeDestructive (c:\GDev\babylon-js\docs\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6076:14)
    at renderIndeterminateComponent (c:\GDev\babylon-js\docs\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5785:7)
    at renderElement (c:\GDev\babylon-js\docs\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5946:7)
    at renderNodeDestructiveImpl (c:\GDev\babylon-js\docs\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6104:11) {
  page: '/'
}

that’s very interesting. Never experienced that.

Does it happen on a specific page, or does no page work?

I’ll try resetting the repo locally and see if I can reproduce. Just making sure - from the error log I am assuming you are using windows?

Yes, I have Windows 11. I see it as soon as I go to the address http://localhost:3000.

1 Like

I just did a fresh install, and I can’t seem to reproduce this. Worked on first try. Quickly searching for the error, i came up with this - javascript - How to fix cannot read properties of null (reading 'useContext')? - Stack Overflow
I am not sure if this will resolve it, and it does seem odd that you experience this issue. I’ll ask the team if they have ever experienced this, but I would probably know if it was the case. I’ll keep on digging! I hope to find a proper answer

1 Like

The proposed solution did not help. And I decided to use the most radical way: restart the PC. And it worked. O_o
Sorry to bother you.

I apologize again, but it wasn’t the reboot that helped. Something else helped, it was just that the reboot coincided with the experiment. If you open the console in the repository directory (cmd) and start the server there (yarn dev or npm run dev), an error will occur.
But if you open the PowerShell console and run npm run dev there, then everything works.

1 Like