Clerk convex logic throws an error every first-time I save while running dev server
I consistently see the function provided on the Clerk+Convex documentation throw on first save, when any convex files have been modified. If I CMD+S again (without file changes) I see the happy message. Odd - I'm just now noticing any time there's an error, the time on save is significantly higher:
β 21:52:06 Convex functions ready! (991.28ms) 6/3/2025, 9:52:06 PM [CONVEX Q(projects:fetchProjects)] Uncaught Error: Can't get current user at getCurrentUserOrThrow (../../convex/users.ts:57:9) at async handler (../convex/projects.ts:10:15) β 21:52:26 Convex functions ready! (394.91ms) β 21:52:32 Convex functions ready! (379.47ms) β 21:52:40 Convex functions ready! (947.86ms) 6/3/2025, 9:52:40 PM [CONVEX Q(projects:fetchProjects)] Uncaught Error: Can't get current user at getCurrentUserOrThrow (../../convex/users.ts:57:9) at async handler (../convex/projects.ts:10:15)Any thoughts why? The functionality of the Clerk webhook + seeding the DB works great, annoying to see these errors on the console though π Below is the code from the docs that's throwing.
6 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Yeah, here is more fuel to that fire -
hit CMD+S a few times in a row, no change- quick turn.
Added a simple LOC to an unrelated file (not to users.ts or projects.ts) and this throws, also took longer.
hit CMD+S a few times again, no change- quick turn.
Removed the simple LOC from that unrelated file (not users.ts or projects.ts) and it throws again, also took longer.

Morning friends - any thoughts on this one? π
I need to see more code to understand what's happening here. The query could be rerun by your client depending on how your local dev server watch is working. Convex will only rerun if something about the query changes, could be a helper function, or a shared dependency.
Can't get current user def means you don't have a user. Where are you calling the function from? Any server side/middleware calls? If it's client, are you skipping until you have an authenticated signal from
isAuthenticated
or the Authenticated component?That's just it - this is calling when my frontend is completely turned off.
so I don't have a damn clue what's calling these functions to run haha!
Whatβs your framework