-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Typescript 4.5 Beta infinite loop leading to JS heap out of memory #689
Comments
For reference, there's another issue here, which I think is probably tracking the same issue (?) |
It's not the same, as Zod was working with TS 4.3, 4.4, and 4.5 until 4.5.0-dev.20210930 (included). There was a pretty large refactoring in TypeScript PR microsoft/TypeScript#41821, and by quickly looking at the diff and the scope of that PR (refactoring recursion-related code) it may very well have introduced this kind of regression. However, I don't know if Zod is using a faulty behavior of TS that was fixed in 4.5.0-dev.20211001, or if it's a real new TS issue. |
I just tried on a blank setup (Mac M1, without node previously installed), same issue. Better to figure this out before TS 4.5 is released. |
Well, there is progress. TypeScript was fixed (in microsoft/TypeScript#46326), so now we have a clear error message instead of a memory error. I created a new issue #715. |
Happy to see that fix land. I struggled to solve that issue for most of Saturday and made minimal progress. The |
An issue appeared with TypeScript 4.5.0-dev.20211001 that made tsc go into an infinite loop leading to an out-of-memory error.
tsconfig.json:
package.json:
when using
tsc
directly, the following import cause the issue:when using ts-node instead of tsc, this is the minimum necessary code to cause the issue:
Demo code in: https://github.com/mmvsk/bug-zod-typescript-4.5.0-oct-01
The same code works until TypeScript 4.5.0-dev.20210930, and the issue was probably introduced with the following TypeScript PR: microsoft/TypeScript#41821
The text was updated successfully, but these errors were encountered: