12.3.x causes `Collecting page data` to fail during build
See original GitHub issueVerify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101
Binaries:
Node: 18.8.0
npm: 8.18.0
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 12.3.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
After upgrading from 12.2.5
to 12.3.0
or 12.3.1
I started getting build errors during “Collecting page data” step. Error output includes
Generating static pages (0/3)TypeError: Cannot read properties of null (reading 'useContext') at exports.useContext
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useContext')
Expected Behavior
Should build without issues
Link to reproduction
https://github.com/WalletConnect/web3modal
To Reproduce
- Pull repository linked above
- Inside
examples/react/package.json
change next.js version to12.3.1
- From root of the repo run
npm install; npm run build
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
next.js - NextJS collecting page data fails with status code 500
Failed at the my-app@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above....
Read more >12.3 - Simple Linear Regression | STAT 200
In this lesson we will be learning specifically about simple linear regression. The "simple" part is that we will be using only one...
Read more >Chapter 12. Encrypting block devices using LUKS
This procedure encrypts existing data on a block device without creating free space for storing a LUKS header. The header is stored in...
Read more >12 Tidy data - R for Data Science - Hadley Wickham
Following three rules makes a dataset tidy: variables are in columns, ... There's a general advantage to picking one consistent way of storing...
Read more >New Residential Construction, November 2022
Privately-owned housing units authorized by building permits in ... standard errors of the most recent data are shown in the tables.
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 Free
Top 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
I could confirm an issue when using
npm
workspaces. Likely introduced by https://github.com/vercel/next.js/pull/39520 since the first release containing the problem isv12.2.6-canary.0
.Switching to pnpm works, so it’s something to do with how npm workspaces handle the dependencies.
Just tried again, essentially
node_modules
in the project12.3.1
npm install
(root)npm run build
(root)Still failing, I noticed that after install total number of packages is
178
, however with next12.2.x
it is177