Convex functions should not be imported in the browser.
I facing this error:
Convex functions should not be imported in the browser. This will throw an error in future versions of
convex
. If this is a false negative, please report it to Convex support.
I didn't directly import the mutation function from convex folder to frontend there, Im using the api + useMutation
Here is my code in convex:
Then the frontend code use like this:
2 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!
Move createUserSchema outside of Convex to resolve this. Best practice is to move any code that is shared between convex code an non-convex code outside of the convex directory.