Building static pages fails with prerendering errors - Cannot read properties of null (reading 'useContext')
See original GitHub issueUpgrade to @keystone-6/ui 2.0.0 (from 1.1.1), run keystone build
Expected: The Admin UI bundle builds successfully. Actual: Building static pages fails with the errors shown in the screenshot below.
Node version v16.15.1.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
How to fix cannot read properties of null (reading 'useContext')?
I tried to debug it, but can't found what really make it those error: cannot read properties of null (reading 'useContext') && react.development ......
Read more >nextjs cannot read properties of null (reading 'usecontext')
During a Bazel build of a NextJs project I get a error related to cjs react. Generating static pages (0/3)TypeError: Cannot read properties...
Read more >TypeError: Cannot read properties of null (reading 'useContext ...
The error is gone when i uninstall material UI. ... You might have better luck finding a solution to your issue if you...
Read more >Advanced Features: Preview Mode | Next.js
js to render these pages at request time instead of build time and fetch the draft content instead of the published content. You'd...
Read more >reading ' context' error when useContext is called in react
Cannot read properties of undefined | reading ' context' error when useContext is called in react. 4.3K views 9 months ago.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @u-ishii
Here are the dependencies from package.json.
According to the docs, that should be all that’s required to run Keystone - is that correct? In addition, this only started happening with Keystone 2.0.0, and with Node version < 18.
met the same issue and resolved it by using the same
react
version. https://github.com/keystonejs/keystone/issues/2898#issuecomment-699130482npm list react
find the react version are using