Opening a .js file when node_modules is present causes explosion in number of watchers
See original GitHub issueIssue Type: Bug
- Disable all extensions
- Open a node project workspace (that contains a
node_modules
folder) with no tabs open - Run
to print the number of file watchers$ find /proc/*/fd -user "$USER" -lname anon_inode:inotify -printf '%hinfo/%f\n' 2>/dev/null | xargs cat | grep -c '^inotify'
- Open a simple javascript file in the workspace
- Re-run the command above several times over the next 10 seconds or so
- You will get a number of file watchers that quickly goes up by something like 20,000 (probably depends on the number of packages in
node_modules
)
As a result I have started to get ENOSPC
errors about reaching the Inotify limit, seems to be since upgrading to VSCode 1.67 (I’m not in control of the version).
This does not happen if you delete the node_modules
folder.
I have the default **/node_modules/*/**
in files.watcherExclude
.
VS Code version: Code 1.67.2 (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5, 2022-05-17T18:23:40.286Z) OS version: Linux x64 3.10.0-1160.66.1.el7.x86_64 Restricted Mode: No
System Info
Item | Value |
---|---|
CPUs | Intel® Xeon® CPU E5-2690 v4 @ 2.60GHz (4 x 2599) |
GPU Status | 2d_canvas: unavailable_software canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: disabled_software multiple_raster_threads: enabled_on oop_rasterization: disabled_off opengl: disabled_off rasterization: disabled_software raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: disabled_software video_encode: disabled_software vulkan: disabled_off webgl: unavailable_software webgl2: unavailable_software |
Load (avg) | 0, 0, 0 |
Memory (System) | 7.62GB (2.22GB free) |
Process Argv | –unity-launch --crash-reporter-id 4cb3165e-6680-471f-992f-0c1e623756f7 |
Screen Reader | no |
VM | 100% |
DESKTOP_SESSION | 1-gnome |
XDG_CURRENT_DESKTOP | GNOME |
XDG_SESSION_DESKTOP | 1-gnome |
XDG_SESSION_TYPE | x11 |
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
React Native Error: ENOSPC: System limit for number of file ...
After installing few node modules I got this error. Running application on PGN518. internal/fs/watchers.js:173 throw error; ^ Error: ENOSPC: ...
Read more >JavaScript Best Practices and node_modules - Julie Ng
Misunderstanding node_modules Here are the largest frustrations with the node_modules folder: it can be very large and easily explode to ...
Read more >Node.js v19.3.0 Documentation
Now, open any preferred web browser and visit http://127.0.0.1:3000 . If the browser displays the string Hello, World! , that indicates the server...
Read more >48 answers on StackOverflow to the most popular Angular ...
An Observable is like a Stream (in many languages) and allows to pass zero ... [hash].bundle.js Your application bundled [ size: 151 KB...
Read more >VS Code API | Visual Studio Code Extension API
** to match any number of path segments, including none; {} to group conditions (e.g. **/*.{ts,js} matches all TypeScript and JavaScript files) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe this helps you @MetRonnie : https://www.typescriptlang.org/docs/handbook/configuring-watch.html
#off-topic/irrelavent.
Do tsserver or vscode have any preferences to exclude a directory from code intelligence in single workspace. Tried
file.exclude
but no luck. reference [(https://github.com/Microsoft/vscode-cpptools/issues/2192)] @sheetalkamat