-
Notifications
You must be signed in to change notification settings - Fork 639
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
Upgrade to 2.X results in many "TS2589: Type instantiation is excessively deep and possibly infinite." errors #1668
Comments
I encountered the same problem. Also in typescript 3.7. |
As this is a typescript bug, there's not much I can do. I could try to find a workaround if I had a way to reproduce this. |
Looking at this comment I guess that the problem could come from something like, defining two models witch have a reference to each other and if the models look something like:
If I have some more time I might try to test if such a case will create this issue. |
I also think this might be the case. I tried using the new import type ModelA from './ModelA'
export class ModelB extends Model {
modelAs: ModelA[]
} Trying if it would help if the references are set only to a type. But that didn't work for me. |
We are having a similar issue in our codebase that only appeared after the 2.x upgrade. The new typings are much improved, but I wonder if it's something related to these typings that is causing these issues. It could very well be a TypeScript issue, as there is an open bug there, but I wonder if there is something that can be done here to help mitigate the issue? I did come across this line from another ORM. Wonder if it could help here? |
There doesn't seem to be any response on typescript side. Would it possible to change the objection.js typings? This issue is blocking me to migrate to the objection v2 without major rewrite. I think that willsoto is right.
Unfortunately I am not sure if I will be able to fix it myself, but I found a PR fixing this issue in other codebase statelyai/xstate#1103. |
@petrdsvoboda I wouldn't be so sure. This issue was just closed less than a week ago on the TypeScript side. Read the last two comments. |
I believe this is now fixed. Please open a new issue if not. |
We upgraded recently our typescript project from 1.6.11 to 2.1.2. Since then we have many Typescript errors: "TS2589: Type instantiation is excessively deep and possibly infinite."
These errors mainly occur in place where we call.
await object.$query().update({...})
orawait Class.query().select('*', knex.raw('....'))
I guess this has somewhat to do with the new types introduced in version 2. In general the functionality seems to work as before. So we are just ignoring this specific error.
Maybe this issue is somehow related to: microsoft/TypeScript#34933?
We use Typescript: 3.7.5
The text was updated successfully, but these errors were encountered: