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

Webpack watch stops if one of the output files is busy #223

Open
Banner-Keith opened this issue Aug 22, 2022 · 3 comments
Open

Webpack watch stops if one of the output files is busy #223

Banner-Keith opened this issue Aug 22, 2022 · 3 comments

Comments

@Banner-Keith
Copy link

This is the same issue reported in #44

When in watch mode, if a file is busy when attempting to emit to it, watch stops functioning.

[webpack-cli] [Error: EBUSY: resource busy or locked, open '{filepath here}'] {
errno: -4082,
code: 'EBUSY',
syscall: 'open',
path: '{filepath here}'
}

Steps to reproduce.
run webpack --watch
save a watched file
output to a file which is currently being used by another process

Most file watchers will try again rather than just shutting down.

In our case I believe that our security software is causing the issue as they are constantly scanning various files. This is not something we can really disable so we just have to retry the watch manually which is a huge pain.

I'd be happy to open a PR with retry logic if you guys are interested. If you have an idea of approximately where in the code that should be handled that would save me some time, but I can dig through it and figure it out if necessary.

Windows 10
node version: 16.15.1
npm version: 8.13.2
webpack version: 5.74.0

@alexander-akait
Copy link
Member

Sounds resonable, but I think it is better to create an option to skip these errors/problems (maybe even with busy: bool | number), false disable reporting, true - current behaviour, number - count of retries, what do you think?

@Banner-Keith
Copy link
Author

Banner-Keith commented Aug 29, 2022

That sounds reasonable to me. Any of those options would be enough to get me past my issue.

@alexander-akait
Copy link
Member

Feel free to send a PR 👍

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

No branches or pull requests

2 participants