-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Compiler hang when importing big JS file with --allowJs #17033
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 tried to profile what's going on here and trying to capture a CPU profile for any length of time (even 1s) will cause the Chrome profiler to crash while processing the CPU profile. |
Profiling probably isn't useful for a 245k file — it's usually a bug or an algorithmic performance problem, both of which usually express themselves as very deep stacks. My initial debugging method is to start debugging and just pause a few times. I'll fall back to profiling (or printf debugging of caches) if there doesn't seem to be a pattern in the locations. There are two relevant meanings of 'location': which node is currently being checked, and where the instruction pointer is when debugging is paused. |
Heya, just wanted to say I have another, simpler repro at https://github.com/filipesilva/tsc-allowjs-big-file. It was inspired by @dzonatan's repro at angular/angular-cli#9636 (comment). It just has a class with a thousand methods:
Running This yields the |
…g files Related to microsoft/TypeScript#17033 Fix #9636
…g files Related to microsoft/TypeScript#17033 Fix #9636
…g files Related to microsoft/TypeScript#17033 Fix #9636
TypeScript Version: 2.4.1
Repro project
When importing a big JS file (a working parser) (245 Kbytes commonjs format) (with
--allowJs
enabled) the compiler hangs forever. Minimal repro project provided: tsc-hang-00Expected behavior:
Compilations ends with or without errors.
Actual behavior:
Compilations hangs forever and keeps consuming CPU.
Tests conditions
The text was updated successfully, but these errors were encountered: