I often get the "Visual Studio Code is unable to watch for file changes in this large workspace" -error and I can't figure out why.
Visual Studio Code (Linux): 1.24.1
My exclude setting is:
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/.svn/**": true,
"**/dist/**": true,
"**/dist-prod/**":true
}
The structure of the project is:
angular.json
/dist
/dist-prod
/e2e
ngsw-config.json
/node_modules
package.json
package-lock.json
proxy.conf.json
README.md
/src
tsconfig.json
tslint.json
xliffmerge.json
.editorconfig
.gitignore
/.svn
/src contains only 167 files and folders. I suspect that node_modules is not really excluded. But I can't know for sure. Is my settings correct?
The problem goes away after VSC is restarted, but it always comes back after a while...
Common issues on Windows# You can check and disable compatibility mode by right-clicking on the VS Code executable and selecting properties, then uncheck the Run this program in compatibility mode option in the compatibility tab.
File & Folder Watcher This extension allows configuring commands that get run whenever a file is saved or folder is changed in vscode.
you've to increase the limit. Follow the below procedure:
cat /proc/sys/fs/inotify/max_user_watches
sudo vim /etc/sysctl.conf
fs.inotify.max_user_watches=524288
:wq!
sudo sysctl -p
cat /proc/sys/fs/inotify/max_user_watches
if the count is same, execute the following command
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
For more details
Happy coding :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With