Replies: 63 comments 86 replies
-
Furthermore, you can likely drop |
Beta Was this translation helpful? Give feedback.
-
Have the same issue |
Beta Was this translation helpful? Give feedback.
-
SOLVED: |
Beta Was this translation helpful? Give feedback.
-
Same issue, but with useRouter |
Beta Was this translation helpful? Give feedback.
-
For what it's worth, I was running into this same issue on Node 16.16.0, and upgrading to 18.5.0 resolved it. 🤷 |
Beta Was this translation helpful? Give feedback.
-
Got this error after upgrading the app from Next 13.1.6 to the latest Next 13.4.0, including some other dependencies, and deploying to Vercel:
Locally everything is perfect. Fails on Vercel. Made sure that local and remote Node version is 18. That didn't help. |
Beta Was this translation helpful? Give feedback.
-
I am still getting this error in 13.4.3 , however I am using turbo repo on top of it which seems to trigger the bug |
Beta Was this translation helpful? Give feedback.
-
Same error in next ^13.4.4 |
Beta Was this translation helpful? Give feedback.
-
Same error in Next 13.4.6 under Downgrading to Next 13.4.5 works |
Beta Was this translation helpful? Give feedback.
-
Had a same problem in 13.3.0, solved in 13.4.7. |
Beta Was this translation helpful? Give feedback.
-
Dealing with this extremely frustrating error for several days now. |
Beta Was this translation helpful? Give feedback.
-
I confirm this in 13.4.8, I downgraded to 13.4.5 and the same thing. |
Beta Was this translation helpful? Give feedback.
-
Out of curiosity are you using React Context? Or a library that uses React Context? |
Beta Was this translation helpful? Give feedback.
-
I faced the same issue and it was fixed in 13.4.7 version
|
Beta Was this translation helpful? Give feedback.
-
I have this issue right now, any solution? |
Beta Was this translation helpful? Give feedback.
-
I began exploring Next.js yesterday. As a beginner, I encountered an issue when attempting to build a production version using:
However, using a different command resolved the issue:
|
Beta Was this translation helpful? Give feedback.
-
Has anyone actually filed a bug against this?? |
Beta Was this translation helpful? Give feedback.
-
Had same error - Cannot read properties of null (reading 'useContext' but only faced when using bun switch to pnpm and my project built just fine. |
Beta Was this translation helpful? Give feedback.
-
Well, as 90% of bug cases on node.js dev I had removed the I could do that because is a newly project but otherwise I don't think it's the best solution.
|
Beta Was this translation helpful? Give feedback.
-
Recently upgraded Nextjs from 12 to 14 in our monorepo and faced with similar issue on NextJs 14.1.4
We are using Page router but the fix mentioned in link above is for app router |
Beta Was this translation helpful? Give feedback.
-
Same happened to me. I tried downgrading, upgrading, pretty much played with everything, just to find out that I needed a clean machine. |
Beta Was this translation helpful? Give feedback.
-
Only next@13.4.5 worked for me, unfortunately, the rest of them are going to null pointer useContext... "next": "13.4.5" bun --bun run build host uname -a Linux Precision-3571 6.8.1-060801-generic #202403151937 SMP PREEMPT_DYNAMIC Fri Mar 15 19:52:22 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux docker uname -a Linux docker 6.8.1-060801-generic #202403151937 SMP PREEMPT_DYNAMIC Fri Mar 15 19:52:22 UTC 2024 x86_64 GNU/Linux |
Beta Was this translation helpful? Give feedback.
-
I faced this error too. |
Beta Was this translation helpful? Give feedback.
-
For anyone who's running into this error, make sure you have a standard |
Beta Was this translation helpful? Give feedback.
-
Spent a night on this issue. Nextjs 14.1.3 Had both: I was able to The real issue is with the package manager versions. I am using
Hope this will save some time. |
Beta Was this translation helpful? Give feedback.
-
This is how I fixed it: Prerequisite conditions:
Fix:
I appreciate that this might not be a solution for those not dealing with external deps, but it worked for me. |
Beta Was this translation helpful? Give feedback.
-
Error when building on a production environment, surprisingly did not appear when building locally: TypeError: Upgrading the Next version from EDIT: I know why this error appeared, the version of node |
Beta Was this translation helpful? Give feedback.
-
I had this issue over and over again with next Oddly enough it went away after formatting all files with |
Beta Was this translation helpful? Give feedback.
-
Mine is pretty barebone, and still have this issue
|
Beta Was this translation helpful? Give feedback.
-
For me Issue was due to NODE_ENV env variable. I removed it from .env file ad that fixed the issue. |
Beta Was this translation helpful? Give feedback.
-
Verify canary release
Provide environment information
Which area of Next.js is affected? (leave empty if unsure)
Other
Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
https://github.com/splashsaver/splashsaver.com
To Reproduce
yarn install
.yarn build
.Describe the Bug
Whenever I try to build my Turborepo project I get the following error.
TypeError: Cannot read properties of null (reading 'useContext')
More info:
I get the same error in my
web
app but with the respective paths, thedocs
app builds successfully.When I run the Turborepo project locally the page returns an
Internal Server Error
message and I get the following error.TypeError: Cannot read properties of null (reading 'useReducer')
Expected Behavior
Successful builds.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Beta Was this translation helpful? Give feedback.
All reactions