-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
Ignore copy errors (don't crash the watch process) #548
Comments
I am currently using an approach suggested by this. This is not only cumbersome for a simple copy action, but |
And what is the problem? We continue working... Just throw error(s) |
The problem is "npm run watch" (which calls Click to show full log:The comments surrounded by exclamation marks are made by me.
|
@felixhao28 weird, we should continue watching, maybe you can create small example? |
https://github.com/felixhao28/copy-webpack-plugin-bugrepro
Now open Watch Command Prompt 1 fail catastrophically. |
Thanks, I will look at this tomorrow |
Reproduced 👍 edge case, but I think
My recommendation - copy this file before starting webpack watching, just add command to Feel free to feedback |
Maybe add an option to ignore errors (default action: crash)?
Your first impression was not this:
And this is how normal users feel about it. |
Impossible because it require monkey patching fs module, so all fs methods can be broken (it is unsafe)
Yes, at first I did not think that the error occurred deep in fs/graceful-fs module |
I am running
webpack --watch
to build a NodeJS program with systray's binary. systray uses a native executable binary to create an interactive tray icon on the tray/menu depending on the OS. So the executable must be copied into the output folder to be called upon build.My config:
Expected Behavior / Situation
There should not be any errors or crashes when using
webpack --watch
. Even if the target file is in use.Actual Behavior / Situation
Windows locks all files currently in use to prevent modification and deletion. This creates a problem for copy-plugin when it tries to overwrite the locked file. And then this error crashes the
webpack --watch
process.Modification Proposal
There are three ways:
Based on #497, I guess this should already be on by default but I am not sure why it does not work in my case.
The text was updated successfully, but these errors were encountered: