keystonejs / keystonejs/keystone
Building static pages fails with prerendering errors - Cannot read properties of null (reading 'useContext')
- Dominant language
- TypeScript
- Stars
- 10k
- Forks
- 1.3k
- Avg merge
- 19h 14m
- Merged PRs (30d)
- 19
Description
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.
Contributor guide
Research direction
Reproduce the failure by upgrading @keystone-6/ui from 1.1.1 to 2.0.0 and running `keystone build` with Node v16.15.1. Start from the Admin UI static-page prerendering errors shown in the issue, and consider the work complete when the Admin UI bundle builds successfully without those errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, react, typescript
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100