Issue with type inference using convex-lucia-auth-demo in a mono repo
I've been playing around with the
convex-lucia-auth-demo
trying to get it up and running within a mono repo. I'm specifically losing type inference for the api.users.get that return the lucia auth object.
I just tested a query that was from a previous project, and wrapped with the helpers from the auth demo, in this case:
This works:
This wont work:
3 Replies
I might just lack knowledge here. But i've tried all day to get it working, and have tried several ways of back tracking trying to figure out where it goes wrong.
I've delved deep into the query wrappers, and how they are setup - but i fail to see exactly where the type inference is lost here. I would love if anyone could point me in the right direction.
The project is quite large, but let me know if more context is needed here or any specific files from my project.
hey @oscklm, can you try with https://github.com/get-convex/convex-lucia-auth (docs: https://github.com/get-convex/convex-lucia-auth/blob/master/DOCS.md)
The type inference is definitely quite finicky, and can be broken easily (for example if there's any error, or if any of the definition files is missing).
For either of them you need the
env.d.ts
file set up correctly.GitHub
GitHub - get-convex/convex-lucia-auth: Convex database adapter for ...
Convex database adapter for Lucia Auth. Contribute to get-convex/convex-lucia-auth development by creating an account on GitHub.
Thanks Michael. I’ll take a look, also when I have time I’d love to at least to a try with the current repo I have, and back track to see if I can get it working and learn why. But the project is rather large, so will take a bit of time i think. I’ll update this if and when I learn more.