-
Notifications
You must be signed in to change notification settings - Fork 643
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
v7.0.0. type instantiation is excessively deep and possibly infinite #2230
Comments
Hey @AaronPorts - sorry for the inconvenience! Seems likely related to #2199. Any chance you can provide a minimal reproduction alongside the code snippet? The problem makes sense to me, but before we work on a resolution, I'd like to start with a test case that reproduces. |
Thanks! I'll take a look! |
Initial investigation seems to point to the But when I removed one I wonder if we made something about |
Seems OmitMerge type creates too much overhead |
I think we got a fix in #2231. I'll try and get a review and ship it out. Thanks for a great issue reproduction and all the help here, @AaronPorts. |
Hey @AaronPorts - just merged. You should be able to grab that patch and fix with patch-package locally. I'll try and run a patch build sometime soon for 7.0.1 |
It seems the problem is still occurring when I use chained actions. I have updated my repo to reproduce the issue. |
Thanks for the follow up @AaronPorts. I'll reopen and investigate. |
Confirmed! I'll see what I can do here. |
@thegedge - I've been trying to see if I can fix this with other ways to write I think we may have to revert #2218. The options as I see it are:
I think reverting makes more sense because:
If we get around to rewriting the type systems, we can use the test cases provided by @AaronPorts as a good check to see if we have a sufficiently performant set of types to support a lot more extensions. We can also prioritize fixing the typing for chained extensions so that people don't need to do this as much as they are. I'm going to hold off on a change here for a few days in case you've got a better idea. But if you don't have the time to think about it too much, reverting is an easy path for now and should resolve these issues. |
I guess revert changes is better option until either types rewrite or microsoft/TypeScript#34933 fix. |
I'll poke around, but I'm doubtful we'll be able to make both work with TS as it stands today. If I had to guess, this is likely a matter of too many instantiations (i.e., not depth) and it'll be hard for us to fix that. Unfortunate that we'd have to make our types incorrect in the override scenario, but agreed with your intuition on this issue being worse than that scenario, @coolsoftwaretyler. [EDIT] Or perhaps there's some other way to architect these types to make it all work. If anyone has ideas, throw 'em my way and I'd be happy to try it out! |
Thanks for trying, @thegedge! I'll revert those changes, and we can revisit the root problem (the builder pattern) once we have a clearer roadmap. I should have some more info for ya in early 2026 on my end. |
Revert PR here: #2234 |
Fix released in |
I'm using nested store structure:
After 7.0.0 update I'm getting 2589 typescript error: type instantiation is excessively deep and possibly infinite.
The text was updated successfully, but these errors were encountered: