-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Regression with TS 5. Type instantiation is excessively deep and possibly infinite.ts(2589) #53514
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
Comments
FWIW, this indicates the instantiation limit is correctly doing its job and the types involved need to be simplified. |
@fatcerberus allright but everything was working fine before v5. The max
|
Given that the count was low before, this seems like a possible bug. A reduced repro (i.e. one that doesn't need the entire linked type definition) would be extremely helpful if you're able to provide one. |
I have faced the same issue - on version 5 I started getting instantiation errors. I tried to create minimal example, but unfortunately the example still uses type-fest library. |
This just happened to me while deploying GitHub actions.
This happens with version |
Same issue as @Ellebkey when upgrading I'm not well-versed on TypeScript and node, but it looks like the
|
Same problem here with
|
I have this issue with 5.1.6 and 5.2.2. Still forced to using 5.0.4 |
This issue appears to be about a problem introduced in 5.0; if you are pinning to 5.0, then your issue started in 5.1 and can't be the same as this one. It'd be good to file a new issue with a reproduction of your own. (The same goes to others in this thread.) |
FWIW the original issue (the new error and large instantiation count) bisects to #52392. This isn't the first time this has shown up; note the crosslinked issues on the PR page. @ahejlsberg you might be interested, though I recall this was somewhat expected. |
It also causes issues with typed higher kinded types in some higher order scenarios |
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
5.0.2
(Also tested with5.1.0-dev.20230326
)Please keep and fill in the line that best applies:
⏯ Playground Link
I created a reproduction repo with straight forward reproduction path:
https://github.com/garronej/typescript-v5-instantiationCount-bug-report
💻 Code
The problem is related to typescript 5 instantiating much more object than TS 4.
I know that the problem occurs when involving this framework that has complex type definitions.
🙁 Actual behavior
With TypeScript v5 project fail to compile with
Type instantiation is excessively deep and possibly infinite.ts(2589)
.Because the
instantiationCount
limit (5e6) is reached.Increasing it by modifying TypeScript's source fixes it but intelissense becomes so slow it becomes impossible to work.
On MBP M1:
1679856587162212.mp4
🙂 Expected behavior
With TypeScript v4 it compiles and the devloppement experience is smooth:
Screen.Recording.2023-03-26.at.20.25.38.mov
Thanks to all the team, thanks for your great work!
The text was updated successfully, but these errors were encountered: