clerk and convex user not found
hey guys im currently building a convex and clerk app using next js
after creating the /convex/requests.tsx file, when I open localhost:3000 it showed this error
"
ConvexError: [CONVEX Q(requests:count)] [Request ID: 0cda5aa4aefc6da8] Server Error
Uncaught ConvexError: User not found
at handler (../convex/requests.tsx:56:8)
Called by client
"
Can anyone help me
Thanks!
17 Replies
Why do you have a .tsx file in convex?
can you share more of your code?
Hi @lee I'm actually @Shane teammate for this project
here is the repo for now
https://github.com/AmadeusAnanto/chat-app.git
this is the public version so I deleted the .env and workflow
GitHub
GitHub - AmadeusAnanto/chat-app
Contribute to AmadeusAnanto/chat-app development by creating an account on GitHub.
a bit of detail, the error is from the latest branch (add-friend)
when running the app from the old branch (just the layout) it was still fine
@No.one i don't see any functions (or a file called requests.tsx) in your
convex/
directory, on any branch. can you help me find the code?
i do see the .env file with secrets in it though 😛ah... my bad😅
that's my bad too, i pushed an older version
I just updated it and i re-confirmed it's the updated version
@No.one did you push it to the same repo? Which branch, main is stil empty except for a README
its in the add-friend branch
@No.one and @Shane what are you stuck on, is sounds like there's no user found. It looks like you're using webhooks to sync user events from Clerk. You might have missed this event? You might try deleting the user from clerk and doing the sign up flow again, and look in the logs to see if that Webhook event is being received from Clerk.
Is this based on any template or video or tutorial?
Wondering if it's missing a step
well from what we're understanding, we're currently stuck because clerk suddenly has error no user found
we're confused before coding the add-friend feature, when it was just the layout, there was no problem for signup / sign in
yes we are still following a youtube tutorial
https://www.youtube.com/watch?v=WmMHbLzQI98&t=6419s
we'd been trying to rewatch and recode the add-friend part (since just layout has no problem) but we still ran to the user not found error
so we thought it had something to do with the convex/ clerk connection itself
Code Complete
YouTube
Build a Real-Time Chat App with NextJS, React, ShadcnUI, and Tailwind
⭐ Source Code & Additional Features - https://www.udemy.com/course/real-time-chat-app-with-nextjs-react-tailwind-and-shadcn/?couponCode=CC-YT-30-2
🔨 Advanced coding project Courses at CodeCrafters (40% discount) - https://app.codecrafters.io/join?via=CodeCompleteYT
🌐 10% Discount on Domain.com (use code DOMAIN10) - https://domain.mno8.net/CodeCo...
@No.one Have you tried deleting the user in Clerk and doing the flow again? Then look at the convex dashboard to see if the Clerk webhook is appropriately adding this friend.
we're confused before coding the add-friend feature, when it was just the layout, there was no problem for signup / sign in well from what we're understanding, we're currently stuck because clerk suddenly has error no user foundThe way this works isn't that Convex reaches out to Clerk to ask for the user; instead, when the sign up flow happens a Clerk webhook makes an HTTP request to Convex.
that's this step here
And here's the point in the video where the author shows deleting the Clerk user and signing up again to check that the webhooks are working: https://youtu.be/WmMHbLzQI98?t=2745
That's the next thing I would try, make sure that you see the user in the Convex. Here's the part where the author shows that user existing in the users tables in the Convex dashboard https://youtu.be/WmMHbLzQI98?t=2780 — that's the debugging I would do next.
hello tom and lee thanks again for the help
we encountered another error when we realized our data is not sent to convex is there any idea how to fix this?
Deleted table indexes:
[-] friends.by_conversationdId ["conversationId","_creationTime"] [-] conversationMembers.by_memberId_conversationId ["memberId","conversationId","_creationTime"] Downloading current deployment state... Diffing local code and deployment state Analyzing and deploying source code... ✖ Error: Unable to push deployment config to https://quirky-anaconda-548.convex.cloud
Error fetching POST https://quirky-anaconda-548.convex.cloud/api/push_config 400 Bad Request: InvalidModules: Hit an error while pushing: Loading the pushed modules encountered the following error: Failed to analyze request.js: Uncaught ReferenceError: __dirname is not defined at <anonymous> (../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js:0:17422)
at node_modules/next/dist/compiled/ua-parser-js/ua-parser.js (../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js:0:17446) er-agent.ts:0:20) at node_modules/next/serverer-agent.ts:0:20) at node_modules/next/server.js (../node_modules/next/server.js:9:13) at <anonymous> (../node_modules/@clerk/nextjs/src/server/utils.ts:18:16) we already made sure the domain to push the deployment config is correct
[-] friends.by_conversationdId ["conversationId","_creationTime"] [-] conversationMembers.by_memberId_conversationId ["memberId","conversationId","_creationTime"] Downloading current deployment state... Diffing local code and deployment state Analyzing and deploying source code... ✖ Error: Unable to push deployment config to https://quirky-anaconda-548.convex.cloud
Error fetching POST https://quirky-anaconda-548.convex.cloud/api/push_config 400 Bad Request: InvalidModules: Hit an error while pushing: Loading the pushed modules encountered the following error: Failed to analyze request.js: Uncaught ReferenceError: __dirname is not defined at <anonymous> (../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js:0:17422)
at node_modules/next/dist/compiled/ua-parser-js/ua-parser.js (../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js:0:17446) er-agent.ts:0:20) at node_modules/next/serverer-agent.ts:0:20) at node_modules/next/server.js (../node_modules/next/server.js:9:13) at <anonymous> (../node_modules/@clerk/nextjs/src/server/utils.ts:18:16) we already made sure the domain to push the deployment config is correct
@Shane can you open a separate support post for this? These aren't the same issue.