Why is api.users.current showing error
I asked gemini to fix, gemini is also using "api.users.current" in its code. But my vscode is showing error.
Here is the picture of error.
What is the issue?


22 Replies
You’re trying to call a Convex query that returns the current user - have you written a query to do that?
If you create file at convex/users.ts and export a Convex query named “current”, the code you have would be correct. Then you just need the query to get and return the user.
I have already done that.

Are you running npx convex dev?
bunx convex dev
The file with that query, can you confirm it’s at convex/users.ts? The error is saying there’s no file exporting public convex functions there.
do you mean that file that contains "current" function?

yeah that's it
hmm
What's in your _generated/api.js file

sorry, api.d.ts

yeah it only sees auth.ts and http.ts
convex dev is running with no errors?
I was following a tutorial, when in between of a lecture i stumbled upon this problem.
I haven't completed the complete tutorial, so I am pretty sure it will give error.
but convex dev is running right now right?
any errors from it?
lemme open just a sec
no issue

Is the error still there
no, issue is not there.

what happened, why did that line go away
?
convex dev generates an api from your convex functions - if you make or change functions without it running, the generated api doesn't update
So you'll just want to keep it running when you're working on the project.
Thanks Buddy, for your help 😀
no problem, happy convexing