-
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" even for generated non-recursive type #31619
Comments
Yes, this is known - a conditional type that requires more than 50 steps to instantiate into a concrete type will short out to |
The problem wouldn't exist if that "50" number was configurable. |
Basically a duplicate of #28663, I think? |
I had a PR to make it configurable but there's a good reason it isn't configurable. It's an implementation detail, it could change at some point so that the number doesn't make sense, or the meaning of the number becomes different. Or they might change something so that a number that worked before stops working and you have to bump it up some more. But what value to use is completely arbitrary and can only really be derived by just... Increasing the number and running the compiler till it works |
Even the GitHub syntax highlighting gave up after |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
I'm seeing this error message in VSCode on lines when running "tsc" from the console (from node_modules/.bin, so same version) is succeeding; I have a case where I legitimately need the depth, though it's definitely less than 50, and I've been trying without success to get rid of the stupid message so I can work again |
TypeScript Version: 3.4.5
Search Terms:
Code
Expected behavior:
It should work without error
Actual behavior:
Playground Link:
Related Issues: #30188 (comment)
The text was updated successfully, but these errors were encountered: