Skip to content

NestJS - Type instantiation is excessively deep and possibly infinite #862

@arashi-dev

Description

@arashi-dev

Describe the bug
The object's type returned from betterAuth() is too slow and takes about 10 seconds to iterate the types in NestJS. if I use any properties of the auth.api property, it gives me the error: Type instantiation is excessively deep and possibly infinite

To Reproduce
Steps to reproduce the behavior:

  1. build a nest project using npx @nestjs/cli new my-project
  2. make a new .ts file somewhere in the /src directory
  3. import the betterAuth and run simply call it.

Expected behavior
The type-intellisense must be much much much faster than this.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Node Version: 20.11.0
  • Package Manager: Yarn
  • Typescript Version (as from the official starter template, v5.1.3)

Additional context

tsconfig.json
{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "target": "ES2021",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true,
    "skipLibCheck": true,
    "strictNullChecks": false,
    "noImplicitAny": false,
    "strictBindCallApply": false,
    "forceConsistentCasingInFileNames": false,
    "noFallthroughCasesInSwitch": false
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    lockedLocked conversations after being closed for 7 days

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions