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

renaming node_modules directory with "javascript.updateImportsOnFileMove.enabled" option set to "always" causes crash #47047

Open
ncpa0cpl opened this issue Nov 21, 2021 · 1 comment
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Help Wanted You can do this
Milestone

Comments

@ncpa0cpl
Copy link

ncpa0cpl commented Nov 21, 2021

TS Template added by @mjbvz

TypeScript Version: 4.5.2

Search Terms

  • updateImports
  • npm
  • node_modules

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.62.0
  • OS Version: Manjaro Linux

Steps to Reproduce:

  1. set javascript.updateImportsOnFileMove.enabled to always
  2. install and import multiple dependencies
  3. change the directory name of the "node_modules" to anything else

When doing so VSCode attempts to update imports of many of the files inside the node_modules and if you have too many dependencies the amount of files it attempts to update is too high and causes the program to stop responding.

The worst part is that simply killing the application and starting it again doesn't necessarily fix the problem, in my case all of the updated files have opened in the editor as unsaved and persisted between closing and opening the application causing it to crash every time I opened it.

Perhaps the auto import update should never happen for any files in the node_modules, regardless of the user settings?

@mjbvz mjbvz transferred this issue from microsoft/vscode Dec 6, 2021
@mjbvz
Copy link
Contributor

mjbvz commented Dec 6, 2021

Yes I think we should never try to update imports under node_modules (although someone on the TS team will have to confirm that there aren't weird edge cases around this)

@mjbvz mjbvz removed their assignment Dec 6, 2021
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Dec 7, 2021
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Dec 7, 2021
@RyanCavanaugh RyanCavanaugh added Domain: Refactorings e.g. extract to constant or function, rename symbol Help Wanted You can do this labels Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants