Large codebase: internal type only shows one module
Apologies for the AI summary of the issue, but I've been banging my head on this all day. Could really use some help!
Problem: TypeScript says
internal.todoist doesn't exist, but it's in the generated api.d.ts.
Environment: ~200 Convex functions, TypeScript strict mode, Bun runtime
Error:
The Weird Part:
- api.d.ts includes all todoist functions in fullApi (70+ functions)
- internal is defined as FilterApi<typeof fullApi, FunctionReference<any, "internal">>
- But TS resolves internal to only show routines module, not todoist
One file shows: error TS2589: Type instantiation is excessively deep and possibly infinite
Structure:
Tried:
- Cleared TS cache, regenerated with --typecheck=disable
- Fixed directory permissions
- Verified individual files compile fine
- Confirmed all functions use correct decorators (internalMutation, internalQuery)
Questions:
1. Is there a limit to functions in FilterApi?
2. Could the "type instantiation depth" error be causing partial type resolution?
3. Best practices for large Convex projects?
Currently using @ts-expect-error everywhere which defeats type safety. Any ideas?0 Replies