Typeorm not compiling with Typescript 3.6.2 - "Excessive stack depth"
See original GitHub issueIssue 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:
- Created 4 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This was solved in the latest TypeORM version
0.2.19
. Working with typescript3.6.3
.Looks like issue was resolved some time ago.