Replies: 106 comments 134 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.
-
The problem started to occur at 14.2.4 and has not been resolved since 14.2.5 during repeated pnpm i. I have deployed this repository to Vercel and it seems to be fine in production. I am hoping for an early resolution. |
Beta Was this translation helpful? Give feedback.
-
In my case the issue was using Extracting hook and whole logic into seperate file that is imported to |
Beta Was this translation helpful? Give feedback.
-
My situation was a little different as I was trying to deploy to Vercel with my Next.js application when this error occurred in the Vercel deployment logs. What ended up working for me was deleting my node_modules before I pushed to github, so that Vercel would recreate it. I also added node_modules to my .gitignore to prevent it from being added in the future. I tried this after trying every solution in this forum for the issue. I am still using version 14.2.5 for Next. I don't think there is a straightforward answer to this issue honestly. |
Beta Was this translation helpful? Give feedback.
-
My team and I started facing this issue for over two months ago and it always seems to occur in only two of our pages. We manage to recreate this issue locally (not always consistently) only when first running the app since on HMR the error would not occur again. After quite a bit of investigation, the only thing that seemed to trigger this was an API call on server side that was resulting on a 404 and to verify if this was the culprit, we moved these API calls (and any custom functionality around it) into a new API route in the app and executed the call to said API route on client side. Ever since doing this it seems we no longer can recreate this error. This is by no means a solution and I'm only sharing this to point out that this very much seems to be an issue on NextJS side when it comes to server rendering and error handling before handling client side, independent of your setup (if the distinction between server/client components on your app is correct) and that a failing API call on server seems to be trying to access a context on NextJS side (I believe it's the |
Beta Was this translation helpful? Give feedback.
-
I was facing the same issue, both locally as well as on vercel. I fixed it by downgrading eslint and eslint-config-next packages. Now it's fixed both on local as well as on vercel. I'll leave the exact steps below.
|
Beta Was this translation helpful? Give feedback.
-
I was using Turborepo with Next.js and Shadcn UI. I faced same issue when running the build command, so I checked the version of my dependencies and found a conflict with next and react versions. It was because I was using a release candidate version of Next.js. After resolving the conflicts, everything worked. |
Beta Was this translation helpful? Give feedback.
-
I had the same issue with |
Beta Was this translation helpful? Give feedback.
-
I've noticed that this happens when reloading after I have had a client side error and the error boundary is hit. |
Beta Was this translation helpful? Give feedback.
-
Possible fix "use client"; //tells Next.js to render this component on the client
export { SessionProvider as AuthProvider } from 'next-auth/react' |
Beta Was this translation helpful? Give feedback.
-
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ok bruh bruh bruh bruh bruh I am trying to use React and Next.JS to statically export it onto gh-pages and I am getting that error |
Beta Was this translation helpful? Give feedback.
-
I have tried most of the solutions suggested above and other than downgrading to an earlier version (13.5.6) from my current version (14.0.4) and pretty much nothing has worked - or even given me different errors. I encountered the issue midway through developing a new feature on a branched version of my app. Going back to my Unfortunately, none of the changes reproduced the error so I couldn't actually identify any specific patterns that would help. However, the new branch was buildable and deployable without the error. I'm not sure what this means, or if it helps anyone. It clearly not a sustainable "solution" but it is another piece in the puzzle... |
Beta Was this translation helpful? Give feedback.
-
In my case, I'm using so much libs in root package.json with yarn-berry based mono-repo. |
Beta Was this translation helpful? Give feedback.
-
same here i try to the flowing steps to fixed my case: 1, delete the i hope it will help someone |
Beta Was this translation helpful? Give feedback.
-
Changed from pnpm to npm, suddenly it works |
Beta Was this translation helpful? Give feedback.
-
Same with 2 projects, one big project and now with a new project I just created(today) |
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