Skip to content
Discussion options

You must be logged in to vote

Hey @adiranawal,
I ran into a very similar issue when building on Windows, and in my case it turned out to be a combination of Next.js prerendering the _error page and a dependency (Radix UI in particular) importing useContext in a non-client context.

A few things that fixed it for me:

Ensure client components have "use client"

Next.js 15+ is stricter about when hooks like useContext can run.
If any of your components (or a dependency’s wrapper) calls hooks but is being rendered on the server, you’ll get this error.

Check:

// Add this to the top of components that must run on the client
"use client";

For Radix UI components, you may need to wrap them in your own "use client" file, then im…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by arjunresha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants