-
Notifications
You must be signed in to change notification settings - Fork 13k
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version:
1.61.2 (system setup)
& maybe?1.61.0 (system setup)
- OS Version:
Win10 Education 20H2 (OS Build 19042.1237)
This was occurring on an earlier version which prompted me to finally click Help -> Install Update
. The new version exhibits the same issue. I did not make a note of the version I was coming from, but I can't recall doing an update in the last 7 days so it might be earlier than 1.61.1
.
Steps to Reproduce:
-
Create a javascript file anywhere, or not, this will crash the TypeScript language service even in an unsaved new tab.
-
Paste the following code: [BUG # 1]:
class ElementsArray extends Array { static { const superisArray = super.isArray; const customIsArray = (arg)=> superisArray(arg); this.isArray = customIsArray; } }
- The TypeScript language service should now crash.
- You may have to
Reload Window
or close vscode and relaunch it. This may only occur if a tab is open with the above code on vscode statup or Typescript Language Service startup. I can't check now because of bash.exe side-effect ([BUG # 3] further down) caused by this bug.
-
With the TypeScript language service now crashed > 5 times. The ErrorReporter will prompt you to report the error.
-
[BUG # 3]: The TypeScript Server crashing is resulting in lingering
bash
shells and apparently there is a limit of 32.
-
- EDIT: This actually brings about yet another bug:
[BUG # 4]: VSCode refuses to display thePROBLEMS OUTPUT DEBUG CONSOLE TERMINAL
panel if the terminal can't be started.
- EDIT: This actually brings about yet another bug:
EDIT2:
I failed to mention the issue with the TypeScript language service crashing has existed for well over a month, maybe months even. Until this point I would just ignore it and avoid the file that causes the crash. I never tried to report the issue in the past because I was in fact using an older TypeScript version.
Today I finally became annoyed enough to look into it after running into and being impeded for the n-th time by the fatal error - console device allocation failure
- which breaks unrelated things system wide.
I slowly removed code from that file until I was left with only the code that would cause the crash, then simplified it further to the 7 line snippet above.
After finding the root cause, I updated my typescript version to latest so that I could submit the issue. Then the rabbit hole got deeper.
EDIT3:
I originally submitted this to the vscode repo instead of the TypeScript repo because my primary beef is with vscode leaving bash.exe consoles open. I also thought the ErrorReporter being broken was a vscode thing.
Yes, the root cause is the TypeScript language server, but I feel vscode's handling of a failed language server is poor.