Shane
Shane7mo ago

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
Nishil Faldu
Nishil Faldu7mo ago
Why do you have a .tsx file in convex?
lee
lee7mo ago
can you share more of your code?
No.one
No.one7mo ago
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.
No.one
No.one7mo ago
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
lee
lee7mo ago
@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 😛
No.one
No.one7mo ago
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
ballingt
ballingt7mo ago
@No.one did you push it to the same repo? Which branch, main is stil empty except for a README
No.one
No.one7mo ago
its in the add-friend branch
ballingt
ballingt7mo ago
@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
No.one
No.one7mo ago
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
No.one
No.one7mo ago
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
ballingt
ballingt7mo ago
@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 found
The 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.
ballingt
ballingt7mo ago
that's this step here
No description
ballingt
ballingt7mo ago
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
ballingt
ballingt7mo ago
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.
No description
Shane
ShaneOP7mo ago
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
erquhart
erquhart6mo ago
@Shane can you open a separate support post for this? These aren't the same issue.

Did you find this page helpful?