question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Opening a .js file when node_modules is present causes explosion in number of watchers

See original GitHub issue

Issue Type: Bug

  1. Disable all extensions
  2. Open a node project workspace (that contains a node_modules folder) with no tabs open
  3. Run
    $ find /proc/*/fd -user "$USER" -lname anon_inode:inotify -printf '%hinfo/%f\n' 2>/dev/null | xargs cat | grep -c '^inotify'
    
    to print the number of file watchers
  4. Open a simple javascript file in the workspace
  5. Re-run the command above several times over the next 10 seconds or so
  6. 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
Extensions: none

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bpaserocommented, Jun 10, 2022
0reactions
logesh14commented, Jul 15, 2022

#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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found