New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS2321: Excessive stack depth comparing types 'MongoRepository<Entity>' and 'Repository<Entity>' #3194
Comments
Have no idea. @Dverlik did you figure this out? |
@pleerock Well, I injected both At some other projects I gave up and moved to MySQL. Some people said adding |
Im sorry about your experience but glad that you moved to relational database haha. I'll close it, if somebody reproduce this error please provide some example. |
Same Excessive stack depth comparing types 'T' and 'DeepPartial' error with MySQL here.
|
@oDjonathanKrause please provide some reproduction |
Database system/driver: TypeORM version: Steps to reproduce the error: But if the class model its passed by param using it to get the repository and save, The error it's throwed "Excessive stack depth comparing types 'T' and 'DeepPartial'. [2321]". The workaround was to create an instance of the Model on the constructor the generic class, clone it and pass the attributes of param object to the cloned object before save.
|
this solved it for me ! |
Updating ts-node to 8.2.0 solved it for me! |
Skip this problem temporarily by setting |
The error occurs for me after updating to newest release of TypeScript@3.6.2. With TypeScript@3.5.3 everything works fine. |
Same error (TS2321) shows up in my application with TypeScript 3.6.2 while using |
We've just downgraded to typescript@3.5.3 to solve the issue. |
Seems like an issue with the latest typescript version, for the time being decided to stick to typescript 3.5.3 |
Also seeing this, and will stick to typescript@3.5.3 |
i'm using typescript@3.5.3 but i still get this issue.
|
I upgraded to latest versions, error is more precise:
|
I have the same error. The weird thing is that it shows |
I'm trying to use FoalTS which includes typeorm and immediately encountered the same |
Same error on 3.6 when using |
@pleerock can you reopen this ticket? |
FWIW, this error does not occur when using It does occur regardless of version of TypeScript, having tested multiple releases of |
I can confirm that the issue seems to be fixed in typeorm v0.3.0-alpha.23 :) |
v0.3.0-alpha.23 aka next, is currently Ah, a more palatable solution (for me) is to use |
@lookfirst does Typescript 3.6.3 fix the issue for you? |
This comment has been minimized.
This comment has been minimized.
@alexmantaut |
Me neither, I'm at ^3.8.3 |
I cannot replicate this. Can someone create a repository that replicates this problem? |
Related to microsoft/TypeScript#34933 |
When opening an issue, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This boils down to ensuring your code that reproduces the problem follows the following guidelines:
MinimalThe more code there is to go through, the less likely people can find your problem. Streamline your example in one of two ways:
Don't sacrifice clarity for brevity when creating a minimal example. Use consistent naming and indentation, and include code comments if needed. Use your code editor’s shortcut for formatting code. Don't include any passwords or credentials that must be kept secret. CompleteMake sure all information necessary to reproduce the problem is included in the issue itself. If the problem requires some code as well as some XML-based configuration, include code for both. The problem might not be in the code that you think it is in. Use individual code blocks for each file or snippet you include. Provide a description for the purpose of each block. DO NOT use images of code. Copy the actual text from your code editor, paste it into the issus, then format it as code. This helps others more easily read and test your code. ReproducibleTo help you solve your problem, others will need to verify that it exists. Describe the problem. "It doesn't work" isn't descriptive enough to help people understand your problem. Instead, tell other readers what the expected behavior should be. Tell other readers what the exact wording of the error message is, and which line of code is producing it. Use a brief but descriptive summary of your problem as the title of your question. Eliminate any issues that aren't relevant to the problem. If your question isn’t about a compiler error, ensure that there are no compile-time errors. Double-check that your example reproduces the problem! If you inadvertently fixed the problem while composing the example but didn't test it again, you'd want to know that before asking someone else to help. |
Pretty sure this is a typescript issue, though, which was linked. If you believe it isn't, please create a new issue with a reproducible example. |
Hello everyone, getting this error :
|
Issue type:
[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[x]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
I am trying to build an API with typeorm and type-graphql. The following code should work, but it gives me a strange error:
[at-loader] TS2321: Excessive stack depth comparing types 'MongoRepository<Entity>' and 'Repository<Entity>'.
It works just fine, if I use
Repository
instead ofMongoRepository
, and I've found a way to circumvent this by callingcreateEntityCursor(query)
, but I want to use projections in my queries. The projection object cannot be passed tocreateEntityCursor()
, andfind()
&findOne()
methods raise thatTS2321
error. I've also found this typescript issue, but I am unsure what to do next. Is there a way to get pass this error?The text was updated successfully, but these errors were encountered: