Skip to content
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

[Bug]: Watchpack "ignored" configuration causes to many watchers in larger projects and blocks startup #23696

Closed
yhaering opened this issue Aug 3, 2023 · 1 comment · Fixed by #24553

Comments

@yhaering
Copy link

yhaering commented Aug 3, 2023

Describe the bug

The current default configuration for watchpack in the core-server package only excludes root level node_modules folders (see here) which will cause way to many watcher instances beeing opend in monorepository structures. As the result of 5k+ watchers beeing opened, either the OS will throw an "Watchpack Error (watcher): Error: EMFILE: too many open files" or will try to close thousands of watchers which takes ages. (10 minutes in my case, known issue in watchpack webpack/watchpack#222)

To Reproduce

  1. Create a monorepository with node_modules folder in sub directories.
  2. Start storybook dev with a breakpoint in the watchEventSource.js file https://github.com/webpack/watchpack/blob/main/lib/watchEventSource.js#L66

System

Environment Info:

  System:
    OS: macOS 13.5
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 18.12.1 - /usr/local/bin/node
    Yarn: 1.22.19 - ~/.npm-global/bin/yarn
    npm: 7.24.2 - ~/Develop/node_modules/.bin/npm
  Browsers:
    Chrome: 114.0.5735.198
    Safari: 16.6

Additional context

I have already tried updating the ignored list to **/node_modules which works way better. I would highly recommend making this list configurable to also exclude folders like build output, coverage etc.

@Squixx
Copy link

Squixx commented Oct 23, 2023

I'd like to add to this, IMO the --ci property should disable watchmode all together

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants