Auth and circular imports
I am using the default convex auth as my auth provider. I noticed that when i want to do special stuff afterUserCreatedOrUpdated and i use the scheduler to runAfter this will cause a circular import as i need the internal from _generated/api.d.ts and _generated/api.d.ts will import auth.ts(js). I dont know how to possibly avoid this circular import.
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!
Does the circular import cause errors and impact behavior or just log warnings
i dont get errors when pnpm run dev'ing but the fact that circular imports exist is making me anxious
i would like to avoid them tbh
but the more i think about it there more i realize that they are unavoidable when it comes to running internal Actions/Queries/Mutations
Circular import warnings really are just warnings. In this case the circular import is a type, so it isn't actually impacting runtime. If it's working, I'd say don't sweat it.
so going based of the fact that it is only a declaration file i should be good?
Yeah, it's not a runtime thing