Skip to content

tsserver watches node_modules directory unnecessarily #33338

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

Closed
danyq opened this issue Sep 10, 2019 · 3 comments
Closed

tsserver watches node_modules directory unnecessarily #33338

danyq opened this issue Sep 10, 2019 · 3 comments
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@danyq
Copy link

danyq commented Sep 10, 2019

TypeScript Version: 3.5.3

Search Terms: node_modules watch

Actual behavior:

tsc --watch creates too many inotify watches. For source code with a few hundred files, it creates 17061 watches, shown with this script:
https://unix.stackexchange.com/a/502812

   INOTIFY
   WATCHER
    COUNT     PID     CMD
----------------------------------------
   17061      486  /usr/bin/node /home/danyq-reduct/MONO-REPO/reduct-app/node_modules/.bin/tsc --watch

Moving files out of node_modules causes the count to go down.

   INOTIFY
   WATCHER
    COUNT     PID     CMD
----------------------------------------
   11877    19225  /usr/bin/node /home/danyq-reduct/MONO-REPO/reduct-app/node_modules/.bin/tsc --watch

Expected behavior:

The number of inotify watches should be comparable to the number of source files and not depend on node_modules.

Related Issues:

@sheetalkamat
Copy link
Member

It wont be unnecessary.. If you program includes source files, they will be watched. tsc --listFiles will help you show what files are included in the program. tsc --traceResolution will help you diagnose why.

@sheetalkamat sheetalkamat added the Working as Intended The behavior described is the intended behavior; this is not a bug label Sep 10, 2019
@typescript-bot
Copy link
Collaborator

This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@vikigenius
Copy link

@sheetalkamat I just stumbled onto the same issue. tsc --listfiles lists 247 files. But inotify watcher count is over 5000, is this normal ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants