-
Notifications
You must be signed in to change notification settings - Fork 33
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
Type instantiation is excessively deep and possibly infinite.ts (2589) #116
Comments
Also happens with |
Downgrading from typescript |
Ran into this issue as well. Downgrading |
It's an issue in |
Downgrading |
@shakib609 That's because VSCode uses its own bundled Typescript version by default. |
I have same issue on |
Hi @dotamir Base on microsoft/TypeScript#33132 it should have been resolved. |
@arnaud-deprez yes, My project is using typescrit |
I ran into this issue recently as well. Any update on potential fix? |
It is kind of a hack but I'm currently using this patch as a workaround for this problem: zookatron@8880054 I haven't had time to dig into this too deeply yet but there appears to be some utility types such as Prefer which are frequently used and are creating very deeply nested types which slows down type checking significantly and causes this "Type instantiation is excessively deep" error on recent TypeScript versions. These would need to be refactored into something simpler (though probably less expressive) in order to fully address this problem. |
Hotfix above fixed some cases with containers but getting it on some Navbar.Item elements too now, running [email protected]. Downgrading typescript to 3.5.2 resolved the issue. Would be nice to see this fixed with new versions of typescript. |
hey team, any news on this one? I've had to downgrade to 3.4 to avoid some other issues with 3.5, which isn't ideal. It would seem that this might not be an issue with typescript, more that they have tightened up the limits on this. Most issues that I saw on the TS repo on this issue seems be with the code, not with TS itself. Are there any maintainers looking into this? Is there any ongoing work sorting out the types, maybe introducing ts-toolbelt, or would help be accepted? |
I am just investigating into this myself. It appears the Prefer type doesn't do much. I think the purpose is to allow the types of the variables to be overridden, e.g. change a string into a number, but I can't see any instances of that happening. It's possible it's a leftover from an old pattern. Can anyone point to a place in the code where it's using the Prefer type with something other than an empty interface as the preferred type? Perhaps we could use a conditional type here to bypass the Omit<>, which I assume is the expensive part, when the override type is empty. Maybe use this instead: export type Prefer<P, T> = {} extends P ? T : P & Omit<T, keyof P>; I need to get my machine setup to run this project tonight, but VSCode appears to be happy with it Edit: |
@luhis There does appear to be a lot of places where Prefer is used with an empty interface due to overrides interfaces that are never actually overridden, so a type conditional might help with that. The big one though is in src/base/exotic.ts where Prefer used with the generic TOwnProps type parameter where it will pick up the prop types of the passed component. The author created a useful blog post here with some explanations as to what is going on there. |
TypeScript 3.9 has been released, there are some changes of note here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#speed-improvements
In my branch had all tests passing in TypeScript 3.8, but one error build error in the Breadcrumbs. That disappeared as soon as I moved to TS 3.9. There were a few changes I made to update RBX to TS 3.9, but in theory the error should be gone if you update your project consuming RBX to TS 3.9 |
It is indeed better & functional with Typescript 3.9. However, with the RBX type definitions in play, my editing experience (VSCode/Intellisense) goes from zippy fast to frustratingly slow. YMMV, of course. |
I fixed this issue by updating to TypeScript 3.9.5 and then running "TypeScript: Select TypeScript version" inside VSCode to change it and then restart the editor :) |
For what it's worth this issue seems to have come back in TypeScript v4.x! So stay on 3.9.x! Nevermind! The |
I know this is a late reply...but work around I've found is to use |
there is another option to work around this, use Preact instead of React, for some reason it works much better, the Preact type definitions are simpler or something i suppose |
Hi,
When using NavBar, I got an error in VSCode:
Type instantiation is excessively deep and possibly infinite.ts(2589)
Apparently it's linked to microsoft/TypeScript#30188 where they recommend to use ts-toolbelt for complex types.
The text was updated successfully, but these errors were encountered: