-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
TypeScript installs file watchers, ignoring files.watcherExclude
setting
#183177
Comments
FWIW: If I set the limit to 16K, code uses 8030 watches for no reason. |
It is possible that not VS Code's file watcher is watching these large folders but an extension. As such: Is the issue caused by an Extension?Stop VS Code and from the command line (NOT the integrated terminal in Code), execute: If you see it is an issue with the extension, please run the command Please report the issue to the extension causing this. |
??? |
The glob pattern needs to have trailing |
Well, not sure what kind of glob pattern this is, but tried as suggested with and w/o zless -R inotify-watches.out.gz or |
This only happens with TypeScript project and |
Not really. I just
and Output of inotify-info after opening a file e.g. prisma in modules/.bin/:
So I would say no. |
Ok just to confirm this is coming from our watcher, can you configure |
Does not work: settings.json BTW: if I close all tabs (editors) stop code and start it again, I get
As soon as I open a file it goes up:
|
For me it looks like the pattern gets ignored for all package.json as well as all directories in the CWD. |
Ok that is a good finding, so which file do you open specifically that results in the watch count to increase? Are you opening |
Tried with https://github.com/KaterinaLupacheva/nextjs-dashboard-layout.git to check, whether it happens on other projects as well: yepp. It seems, that watches explode as soon as a *.js or *.tsx? file gets opened. Stays at ~50 watches, if something else like *.json or .gitignore, LICENSE, etc. gets opened (using the same settings.json posted above). |
Thanks, this sounds like the typescript extension is installing watchers, ignoring our setting. |
files.watcherExclude
setting
Anybody working on this nasty thing? |
Falls under #193848 |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
cat >package.json<<EOF
{
"name": "foobar",
"description": "Test",
"repository": "https://github.com/x/y",
"bugs": {
"url": "https://github.com/x/y/issues"
},
"author": "Foo Bar [email protected]",
"contributors": [],
"version": "0.1.0",
"private": true,
"scripts": {
"db": "NODE_OPTIONS='--no-warnings --loader ts-node/esm' nodemon --watch scripts scripts/db.ts",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"clean": "rm -rf .next",
"realclean": "rm -rf .next node_modules package-lock.json"
},
"dependencies": {
"@next-auth/prisma-adapter": "^1.0.6",
"@prisma/client": "^4.14.1",
"next": "13.4.3",
"nodemailer": "^6.9.2",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@styled-icons/material": "^10.47.0",
"@styled-icons/fa-solid": "^10.47.0",
"@types/busboy": "^1.5.0",
"@types/node": "20.2.3",
"@types/nodemailer": "^6.4.8",
"@types/react": "18.2.6",
"@types/react-dom": "18.2.4",
"eslint": "8.41.0",
"eslint-config-next": "13.4.3",
"prisma": "^4.14.1",
"typescript": "5.0.4"
}
}
EOF
4.
npm i
5. with super user privileges:
sysctl fs.inotify.max_user_watches=4096
6. adjust excludes in
~/.config/Code/User/settings.json
. E.g.:No matter, what you specify, code still watches all directories, even so it is not desired at all to watch anything below
./node_models/
. In the example above these are ~ 4K directories. This is a huge waste of resources and should be fixed (beside it causes other problems with other misbehaving apps, which do similar insane things ...).To inspect inotify watches in a very easy way, it is highly recommended to use a tool like inotify-info!
The text was updated successfully, but these errors were encountered: