Error: Could not find Convex client!

Got this error: Error: Could not find Convex client! useMutation must be used in the React component tree under ConvexProvider. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app And yeah. I have set up everything correctly. The site is live already just made some changes to the backend. Can there be another reason why this error is shown? In the image you see that I only made backend changes
No description
8 Replies
FleetAdmiralJakob 🗕 🗗 🗙
This error only appears in dev I made a next prod build of the same code and it worked locally (on Vercel it works too)
ballingt
ballingt•10mo ago
Can you share the client code where use use this useMutation, and the code where you use a ConvexProvider? This error is alway a client-side issue. interesting that it only happens in dev, there are some edge cases like multiple copies of React that can cause this
FleetAdmiralJakob 🗕 🗗 🗙
the mutation isn't in the chat overview. it's in the adduserdialog: https://github.com/FleetAdmiralJakob/chat-io/blob/19f57b63ecd65f238b1dd4afef0a477903db59a0/src/components/homepage/add-user-dialog.tsx#L71 the mutation is in a component that is called AddUser Dialog. this component is called in the /app/(internal-sites)/chats/page.tsx that's the page. it's just calling the component https://github.com/FleetAdmiralJakob/chat-io/blob/chats/src/app/(internal-sites)/chats/page.tsx
FleetAdmiralJakob 🗕 🗗 🗙
there is a nested layout but that's doing nothing special
No description
Michal Srb
Michal Srb•10mo ago
I cloned your repo and set up Clerk and cannot reproduce the error. Maybe try restarting the Next.js server, it's not super reliable?
FleetAdmiralJakob 🗕 🗗 🗙
Restarted my PC -> Did not help Deleting /.next dir -> Solved the problem Thank you for your help!

Did you find this page helpful?