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

100% CPU when installing node_modules while a file is open #30208

Closed
phil294 opened this issue Mar 4, 2019 · 1 comment · Fixed by #35615
Closed

100% CPU when installing node_modules while a file is open #30208

phil294 opened this issue Mar 4, 2019 · 1 comment · Fixed by #35615
Assignees
Labels
Fix Available A PR has been opened for this issue

Comments

@phil294
Copy link

phil294 commented Mar 4, 2019

TypeScript Version: typescript@3.4.0-dev.20190302

Search Terms: tsserver cpu ember reload

Steps to reproduce

This is super-verbose; the relevant steps are bold and should be easy to reproduce

  • Tested in MacOS
  • Clone https://github.com/phil294/tsserver_lag_demo2. (It includes just a few dependencies with which the issue can be reproduced)
  • Open it up in vscode
  • Open process explorer so you can see the CPU usage of tsserver
  • Do not open main.js (if you already have, close the tab & reload)
  • Run rm -rf node_modules && yarn
  • Wait for it to finish
  • Open main.js
  • tsserver cpu goes up to 50% for ~1 second. This is how it should be
  • Keep main.js open
  • Run rm -rf node_modules && yarn
  • Wait for it to finish

Expected behavior:

tsserver should not go mad

Actual behavior:

tsserver cpu goes up to 100% and stays like this for a long time. It varies, but I've had both 30 seconds and 15 minutes. It renders the entire intellisense and go-to mechanics useless. Reinstalling node_modules is one of the most common things to do in a JS/TS project. This bug makes developing Ember.js applications with vscode & typescript intellisense support effectively impossible. For example, in our team, we all had to go back to Sublime Text because of this. The CPU usage is probably related to some dependency in package.json, but I have not been able to narrow it down. Either way, it is a Typescript bug.

Related Issues:
There are multiple tsserver CPU related issues. This one was the most similar but is missing details and is also closed, so probably not related.

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Mar 7, 2019
@sheetalkamat sheetalkamat added Fix Available A PR has been opened for this issue and removed Needs Investigation This issue needs a team member to investigate its status. labels Dec 10, 2019
@sheetalkamat
Copy link
Member

@phil294 Would you be able to try out #35615 (comment) to see if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants