allen
allen6mo ago

API types are "excessively deep" when Convex Auth is installed.

Commenting out the injected auth_* and auth.js imports in api.d.ts resolves this issue. Is this a known bug in Convex Auth? Is there a resolution?
No description
5 Replies
allen
allenOP6mo ago
This is in Webstorm with Typescript 5.5.3
erquhart
erquhart6mo ago
This usually means you have circular inference somewhere in your convex code, typically an action, where the return value of the action includes a value returned by another convex function (called by the action) and both the action and the other function do not have explicitly typed return values.
erquhart
erquhart6mo ago
Actions | Convex Developer Hub
Actions can call third party services to do things such as processing a payment
allen
allenOP6mo ago
Like I mentioned, I've isolated this to the Convex Auth definitions in the api types. This is not my code. If i remove auth: typeof auth; from api.d.ts the ts error goes away. unless I'm misunderstanding how this loops back into some code I've written FWIW I'm using an almost identical implementation of this example for my auth provider: https://github.com/get-convex/convex-auth-example/blob/main/convex/otp/TwilioVerify.ts It turns out having a convex/auth/* folder conflicts with the new Convex Auth api type generation
ballingt
ballingt6mo ago
Ah thanks for figuring this out, interesting

Did you find this page helpful?