Skip to content
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

Bad experience when TypeScript server crashes #22614

Closed
OliverJAsh opened this issue Mar 14, 2017 · 5 comments
Closed

Bad experience when TypeScript server crashes #22614

OliverJAsh opened this issue Mar 14, 2017 · 5 comments
Assignees
Labels
feature-request Request for new features or functionality javascript JavaScript support issues typescript Typescript support issues

Comments

@OliverJAsh
Copy link
Contributor

OliverJAsh commented Mar 14, 2017

Quite often I find the TypeScript has crashed. VS Code gives me no indication of this—I have to look at the server output myself using the panel provided. Tooltips show as "Loading…" indefinitely.

Ideally:

  • We would warn the user the server has crashed, perhaps prompting them to restart the server. It may also be useful to show the loading status of the server, so the user knows when TS is and isn't ready to use. I often find myself hitting "go to definition" multiple times as I wait for it to finish loading.
  • We would provide a way to restart the server An explicit way to restart TypeScript service (tsserver) #22335

image

Not sure why the server crashes, this time round I got this error (omitted stack trace):

Error processing request. symbol.getFlags is not a function
TypeError: symbol.getFlags is not a function
@wrldtrvllr
Copy link

I can confirm the behavior @OliverJAsh describes. Apparently, especially in quite big JavaScript projects the TypeScript server crashes quite frequently.

@jskrzypek
Copy link

Additionally, at least on the mac (including on the latest insider build), quitting vscode does not stop the tsserver process if it does crash. Two orphaned "Code Helper" processes are visible in the activity monitor. I have taken process samples of each, if they would help diagnose this, let me know.

This likely relates to the issues reporting a code helper process running at 100% cpu that is not quit when quitting vscode on mac.

The parent has this process name:
/Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper.app/Contents/MacOS/Code - Insiders Helper /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript/out/utils/electronForkStart /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js --useSingleInferredProject --enableTelemetry --cancellationPipeName /var/folders/3k/qknqm8wd4_5bm0jqhvxz0b400000gq/T/vscode-tscancellation-60e56ab1076cf3ec7636.sock*

@eppsilon
Copy link

eppsilon commented Apr 6, 2017

I think I just experienced something similar to @jskrzypek. I was using VS Code 1.11.0 on macOS 10.12.4 and realized I was at 100% memory pressure when things started to get sluggish. Oddly Activity Monitor did not report that any process was using more than about 1 GB of RAM. I think the Code Helper process was at around 400 MB. Killing that process freed up about 14 GB of "wired" memory.

@mjbvz mjbvz added feature-request Request for new features or functionality javascript JavaScript support issues typescript Typescript support issues labels Apr 21, 2017
mjbvz added a commit that referenced this issue Sep 18, 2018
@mjbvz
Copy link
Contributor

mjbvz commented Sep 20, 2018

6ec7423 adds a "TS server is initializing" indicator to the status bar. This will also show if the server crashes and is restarting

We automatically restart the TS server if it crashes and alert the user if the server crashes multiple times rapidly. There's also a restart ts server command that you can use to manually trigger a restart

I believe this addresses the original points from this issue

@mjbvz mjbvz closed this as completed Sep 20, 2018
@jskrzypek
Copy link

@mjbvz the status bar indicator and the command are definitely a big improvement. Almost all of the time when I notice the TS server has hung and I restart it, it comes back to life and resolves the issues I'm having.

The fact that a significant percentage of the time it hangs again in the same project 20-30 minutes later mostly speaks to the fact that there are other underlying problems. At least now I have a way to recover from them without having to dig into the activity monitor 🎉

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality javascript JavaScript support issues typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

6 participants