question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building static pages fails with prerendering errors - Cannot read properties of null (reading 'useContext')

See original GitHub issue

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.

image

Node version v16.15.1.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
isla-nyecommented, Jun 20, 2022

Thanks @u-ishii

Here are the dependencies from package.json.

  "dependencies": {
    "@keystone-6/core": "^2.0.0",
    "typescript": "^4.5.4"
  },

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.

0reactions
marsk6commented, Aug 28, 2022

image

met the same issue and resolved it by using the same react version. https://github.com/keystonejs/keystone/issues/2898#issuecomment-699130482 npm list react find the react version are using

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found