8000 Filewatcher watches node_modules and other directories it doesn't need to · Issue #178 · evaera/moonwave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Filewatcher watches node_modules and other directories it doesn't need to #178

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

Open
Quenty opened this issue Apr 7, 2025 · 1 comment
Open
Labels
bug Something isn't working cli

Comments

@Quenty
Copy link
Contributor
Quenty commented Apr 7, 2025

Need to add this line to the dev.ts

chokidar
            .watch(projectDir, {
                ignored: (file) => (file.includes("node_modules") || file.includes(".git")),
                ignoreInitial: true,
            })

To have it ignore other modules that aren't needed to be watched, otherwise you can get an error like this

node:internal/fs/watchers:207
      const error = new UVException({
                    ^

Error: EMFILE: too many open files, watch
    at FSWatcher._handle.onchange (node:internal/fs/watchers:207:21)
Emitted 'error' event on FSWatcher instance at:
@YetAnotherClown YetAnotherClown added bug Something isn't working cli labels Apr 7, 2025
@YetAnotherClown
Copy link
Collaborator

prepareProject.js returns an array of paths to watch, we use them to filter out the paths in the fs on event, but I think we could just watch those paths instead of the project directory. I'll take a look into this, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli
Projects
None yet
Development

No branches or pull requests

2 participants
0