#clerk and convex user not found

1 messages · Page 1 of 1 (latest)

narrow pelican
#

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!

stable dock
#

Why do you have a .tsx file in convex?

noble raft
#

can you share more of your code?

half crystal
#

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

noble raft
#

@half crystal 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 😛

half crystal
half crystal
brazen finch
#

@half crystal did you push it to the same repo? Which branch, main is stil empty except for a README

half crystal
#

its in the add-friend branch

brazen finch
#

@half crystal and @narrow pelican 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

half crystal
#

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

half crystal
# brazen finch Is this based on any template or video or tutorial?

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

brazen finch
#

@half crystal 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.

#

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.

narrow pelican
#

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