-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 in version 4.1 #41406
Comments
Experiencing the same with a similar approach. I believe the error wasn't there with typescript 4.1.0-beta, but started to occur with 4.1.1-rc |
Hey guys, I'm facing a similar issue, but it seems to be more like a typescript limitation (despite the data size not being that large). We're relying on those types here, so I cannot simply use |
Currently running into this error on 4.1.2 trying to improve the types in my library. Increasing the constraintDepth limit in getImmediateBaseConstraint() makes the error disappear. +1 for turning this into a tsconfig setting instead of hardcoding it like this - it seems to be an arbitrary limit rather than a technical one. |
My code base is also plagued by this error, sometimes it goes away for a few seconds, sometimes the exact line the error is being thrown changes, even when the code is not modified. It's interestingly inconsistent! |
This reverts commit 1533de7. It resulted into the following error: `Type instantiation is excessively deep and possibly infinite.ts(2589) error is thrown.` which has been issued here: microsoft/TypeScript#41406 Going to remove this until its clear what the cause is.
I'd optimistically increased the number of event overloads, but not consumed it. As part of bumping all packages it turns out we've hit an intrinsic typescript limit for recursive types, which was leading to “TS2589: Type instantiation is excessively deep and possibly infinite” . This change reduces the number of overloads to the number which works, and is still more than we currently use anywhere. There are few typescript issues this could be related to: microsoft/TypeScript#34933 microsoft/TypeScript#41406
This issue no longer reproduces. Closing. |
Still getting this error with the 4.3.5 version. |
Same ☝️ |
Same error still in 4.3.5 |
Might be worthwhile to create a testcase in the playground https://www.typescriptlang.org/play?ts=4.4.0-beta and create a new issue |
For my case, the issue was solved on |
Can confirm that |
Motivation
I wrote a type to make [lodash get[(https://lodash.com/docs/4.17.15#get) and especially formik getFieldProps type safe by writing a generic type which is represent a union of string literal types representing
a full .
separated path to leaf nodes of a possibly nested record.TypeScript Version: 4.1.0
Search Terms:
Code
Expected behavior:
No error is thrown.
Actual behavior:
Type instantiation is excessively deep and possibly infinite.ts(2589)
error is thrown.Playground Link:
This is a link to the playground.
Related Issues:
The text was updated successfully, but these errors were encountered: