Large codebase: internal type only shows one module
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 todoistOne file shows:
error TS2589: Type instantiation is excessively deep and possibly infiniteStructure:
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?