-
Notifications
You must be signed in to change notification settings - Fork 12.8k
5.1 regression from 5.0: JavaScript heap out of memory (Type instantiation is excessively deep and possibly infinit) #54542
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
I can repo this with a simple single-file project that just imports // compile without --strict
import "lodash"; No problems when compiling with |
Hoping someone has time to bisect this so we can identify the source of the issue. |
Bisected to #52106 |
typescript is pinned to 5.0.x because of the following issue: microsoft/TypeScript#54542
@weswigham FYI |
Wild guess, but this may be the cause of the OOM in typescript-eslint/typescript-eslint#7088 based on the timing. |
Confirmed @jakebailey, great spot - thanks! I bisected in typescript-eslint/typescript-eslint#7091 on the individual TypeScript |
Any update on this? Got the same issue when upgrading to typescript 5.1.3 from 4.9.4 and we have @types/lodash : 4.14.195 as devdependencies. |
Same problem with lodash here but with It works fine with typescript This is my error :
|
My workaround for now is to disable interfaces (.d.ts files), using the following code snippet in my local "skipLibCheck": true, More info: https://www.typescriptlang.org/tsconfig#skipLibCheck |
Important to mention that it is a just temporary workaround as it would skip all libraries check. |
Yes workarounds are hopefully temporary in general. I don't like this approach either, but at least I can build again. |
Any chance to fix this? |
Yeah, my serverless framework deploys are broken until this is fixed too. |
Newer versions have a regression and fail to type check at the moment. microsoft/TypeScript#54542
Newer versions have a regression and fail to type check at the moment. microsoft/TypeScript#54542
Can people following the thread verify that #54781 fixes the issue? You can do so by using a specific build of TypeScript: {
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/155637/artifacts?artifactName=tgz&fileId=04DE374095785839F62F13D7F462400B471B8FC647A291E41CD31D23BFD6186002&fileName=/typescript-5.2.0-insiders.20230626.tgz"
}
} (see #54781 (comment)) |
@DanielRosenwasser That build works great and solves the issue for the project where I ran into problems! 🚀 |
@DanielRosenwasser Verified. Works for us, too! |
@DanielRosenwasser confirmed typescript-eslint/typescript-eslint#7088 appears to be fixed, thanks! |
Sorry for my late response, but I can in fact confirms TypeScript v5.2.2 solved all my issues. |
… as rc1 and rc2 requires react-quill changes. upgraded typescript to 5.2.2 to fix issues with lodash microsoft/TypeScript#54542, updated to webpack 5 (webpack@latest) https://www.codingbeautydev.com/blog/error-0308010c-digital-envelope-routines-unsupported
The compilation via "yarn build" does fail otherwise. This can be removed once the dependencies (esp. typescript) are upgraded further. See: DefinitelyTyped/DefinitelyTyped#63022 (comment) See: microsoft/TypeScript#54542
The compilation via "yarn build" does fail otherwise. This can be removed once the dependencies (esp. typescript) are upgraded further. See: DefinitelyTyped/DefinitelyTyped#63022 (comment) See: microsoft/TypeScript#54542
The compilation via "yarn build" does fail otherwise. This can be removed once the dependencies (esp. typescript) are upgraded further. See: DefinitelyTyped/DefinitelyTyped#63022 (comment) See: microsoft/TypeScript#54542
The compilation via "yarn build" does fail otherwise. This can be removed once the dependencies (esp. typescript) are upgraded further. See: DefinitelyTyped/DefinitelyTyped#63022 (comment) See: microsoft/TypeScript#54542
The compilation via "yarn build" does fail otherwise. This can be removed once the dependencies (esp. typescript) are upgraded further. See: DefinitelyTyped/DefinitelyTyped#63022 (comment) See: microsoft/TypeScript#54542
The compilation via "yarn build" does fail otherwise. This can be removed once the dependencies (esp. typescript) are upgraded further. See: DefinitelyTyped/DefinitelyTyped#63022 (comment) See: microsoft/TypeScript#54542
Bug Report
5.0.4
used to work fine after upgrading to the current latest version5.1.3
. Very slow builds and eventually crashes. My root-cause seems to be a circular issue of some sort with tsc.Seems like tsc can't handle interface definition files anymore, in this case from
lodash
?My workaround was adding
"skipLibCheck": true
to the tsconfig.json did mitigate the issue for now.Workaround for me was to add:
"skipLibCheck": true
to the tsconfig.json did mitigate the issue for now.🔎 Search Terms
🕗 Version & Regression Information
I also tried the latest
next
tag, with the same issues.⏯ Playground Link
The "Type is excessively deep" is being triggered in a project that includes this the
@types/lodash
, so in your package.json be sure you have the dependency:Be sure that you did NOT set
skipLibCheck
totrue
. So keep it to false, otherwise thed.ts
files will be ignored.Execute via:
NODE_OPTIONS=--max-old-space-size=8192 tsc --pretty --diagnostics --extendedDiagnostics --incremental false
💻 Code
See below, it doesn't involve my code.
🙁 Actual behavior
JavaScript heap out of memory, because of circular/ too deep dependency?
🙂 Expected behavior
No crashes or errors during
tsc
!The text was updated successfully, but these errors were encountered: