Generated types fall to default when using a schema with 200+ keys
I define all my tables with Zod and it is a great workflow. Using zodToConvex, I convert everything to convex validators before adding it to my defined schema. However, I realized that the generated types fall back to the following when I added around 200+ keys to my Zod schema:
Is this intended?
2 Replies
Hey @milk enjoyer, are you still facing issues with the generated types?
I'm not using Zod, but I do notice a lot of issues with the generated types. I try my best to define all my functions in the following structure to avoid circular references:
But still, my api oftern resolves to "any" and I need to change something in the file to get it to resolve correctly. It's not an issue with my IDE either. Running
tsc
will also resolve many api types as "any" and so I often have type errors that I just miss until I encounter them at runtime.
Are you experiencing something similar?I generate a ton of types (not so much with zod yet) but this issue is usually some other problem in the code. I know several different causes its always best to try to address it as soon as it appears.