question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typeorm not compiling with Typescript 3.6.2 - "Excessive stack depth"

See original GitHub issue

Issue type:

[ ] question [x] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [x] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [ ] postgres [ ] cockroachdb [ ] sqlite [ ] sqljs [ ] react-native [ ] expo

TypeORM version:

[ ] latest [ ] @next [x] ^0.2.18 (or put your version here)

Steps to reproduce or a small repository showing the problem:

  • Try to build a project containing typeorm (version 0.2.18 in my case) with the newest typescript version (I used Typescript 3.6.2)
  • Get an error message looking like:
Error TS2321: Excessive stack depth comparing types 'MongoRepository<Entity>' and 'Repository<Entity>'.

[redacted]/api/node_modules/typeorm/repository/MongoRepository.d.ts(12,22): error TS2589: Type instantiation is excessively deep and possibly infinite.

[redacted]/api/node_modules/typeorm/repository/MongoRepository.d.ts(45,5): error TS2321: Excessive stack depth comparing types '(optionsOrConditions?: string | number | Date | ObjectID | FindOneOptions<Entity> | Partial<Entity>, maybeOptions?: FindOneOptions<Entity>) => Promise<Entity>' and '{ (id?: string | number | Date | ObjectID, options?: FindOneOptions<Entity>): Promise<Entity>; (options?: FindOneOptions<Entity>): Promise<Entity>; (conditions?: FindConditions<Entity>, options?: FindOneOptions<...>): Promise<...>; }'.

Temporary workaround

Rollback to Typescript 3.5.3, then compiling works again.

EDIT Sept. 16, 2019: A fix has been deployed, see https://github.com/typeorm/typeorm/issues/4681#issuecomment-531512317

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
juandacocommented, Sep 14, 2019

This was solved in the latest TypeORM version 0.2.19. Working with typescript 3.6.3.

0reactions
Kononnablecommented, Nov 11, 2019

Looks like issue was resolved some time ago.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeORM throws "Type instantiation is excessively deep ...
typescript - TypeORM throws "Type instantiation is excessively deep and possibly infinite. ts(2589)" error on Repository typing - Stack ...
Read more >
type-graphql/Lobby - Gitter
Well, for a projection I have to use MongoRepository, and this is blocked by the [at-loader] TS2321: Excessive stack depth comparing types ...
Read more >
Notices_BigFix_Lifecycle_Starter...
Please note: This Notices file may identify information that is not used ... MIT node-14.6.2.tgz TypeScript definitions for Node.js.
Read more >
Full-Stack TypeScript with Ionic, Angular, and NestJS Part 2
TypeORM supports the most common relational databases: such as MySql, PostgreSQL, SQLite, MS SQL, and more. Setting up your database instance is ...
Read more >
Search Results - CVE
1 is vulnerable to reflective cross-site scripting (XSS). The web application does not adequately sanitize request strings of malicious JavaScript. An attacker ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found