keystone: Building static pages fails with prerendering errors - Cannot read properties of null (reading 'useContext')
Upgrade 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.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 19 (8 by maintainers)
@kirandash the suggestion also works for me.
Fresh starting a Keystone app with
yarn create keystone-app
will install the required dependencies andyarn dev
will start the app. However visiting any page will throw an exception:Cannot read properties of null (reading 'useContext')
I got it to work for node v20
@kirandash try this solution #8553 . It works to me
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.