AbdulA
Convex Community13mo ago
2 replies
Abdul

Type instantiation is excessively deep and possibly infinite.

I’m encountering the following TypeScript error in my project:
Type instantiation is excessively deep and possibly infinite

I’m new to TypeScript and don’t have much experience with its type system. My project has a complex directory structure with multiple levels of nesting, and I suspect the deeply nested structure might be causing the issue.

Here is how directory structure roughly looks like:

project-root
├── generated
│   ├── api.d.ts
│   ├── api.js
│   ├── dataModel.d.ts
│   ├── server.d.ts
│   └── server.js
├── core
│   ├── index.ts
│   ├── utilities.ts
│   └── types.ts
├── modules
│   ├── featureA
│   │   ├── helpers.ts
│   │   ├── logic.ts
│   │   ├── types.ts
│   │   └── subFeature
│   │       ├── core.ts
│   │       ├── subLogic.ts
│   │       └── subTypes.ts
│   ├── featureB
│   │   ├── handlers.ts
│   │   ├── queries.ts
│   │   └── types.ts
│   └── shared
│       ├── auth.ts
│       ├── config.ts
│       └── utils.ts
├── queries
│   ├── featureAQueries.ts
│   ├── featureBQueries.ts
│   └── sharedQueries.ts
├── schema
│   ├── entities
│   │   ├── entityA.ts
│   │   ├── entityB.ts
│   │   └── entityC.ts
│   ├── relations.ts
│   └── types.ts
└── webhooks
    └── eventHandlers.ts


Are there general best practices for handling query and mutation definitions in a project with this kind of nested structure?
Was this page helpful?