Closed mbulfair closed 5 years ago
@mbulfair Sorry I don't have enough information to help you. Please provide a minimal repository to demonstrate the problem you are having.
@chrisblossom I wish I could, sharing details is private sadly. The repo is in our github enterprise. For now I have to leave things using 2.0. The only option I pass is verbose:true, everything else is default. My best guess is under /dist/ theres a folder /min/ and it's trying do something on cleaning..
I'm not asking for the full repo, just a minimal example. That or fork this repo and put a PR in with a failing test demonstrating the issue. Not sure how I can help otherwise.
One thing I noted is that 3.0 seems to remove files after loaders have run, which I've found very confusing. 2.0 deleted files before loaders.
Maybe this is the same issue?
One thing I noted is that 3.0 seems to remove files after loaders have run, which I've found very confusing. 2.0 deleted files before loaders.
This is because clean-webpack-plugin
should not remove any files if the compilation fails, which includes loaders. Loaders should not directly write any files either, instead should use webpack's compilation.assets
API.
@mbulfair do you have any plugins that are writing directly to disk? Can you paste your full webpack configuration?
I'm having the same issue after updating to 3.0, but it only happens sporadically. I think that the culprit may be copy-webpack-plugin
since I'm using that to copy files around. @mbulfair Are you using this plugin as well?
@alienriver49 can you provide a minimal repository that demonstrates your issue?
@chrisblossom Yep! Let me see if I can get you something together today or tomorrow.
@chrisblossom I created a repo here, but it's not duplicating this issue yet. I know I have seen this issue occur, but it's not consistent. I have noticed another, similar, issue though which can be duped with this repo. After doing the initial build, open the dist/release folder in Windows Explorer, then run the build several times and you'll end up with this error: "Error: EPERM: operation not permitted, mkdir 'C:\Workspace\Github\clean-webpack-plugin-issue-146\dist\release\js'"
I notice this one a lot since I copy the build output to a shared drive after making changes, which I do pretty frequently. This error did start happening with 3.0; with 2.0 Windows Explorer would display a popup or Windows Explorer would bring you back to the root of the repo. I figured it was worth mentioning since it's similar. I will continue to try duplicating the original issue and if I do, I'll update that repo and let you know.
Try placing clean-webpack-plugin
first on the plugin list and let me know if that solves the problem. See https://github.com/johnagan/clean-webpack-plugin/issues/150.
That fixed the other issue I mentioned last week! I'm not sure about the original issue, but if I had to guess, that same change would fix it as well.
Thanks @alienriver49 for reporting back. Please let me know if you see the original issue solved for you as well.
@mbulfair Can you report back if https://github.com/johnagan/clean-webpack-plugin/issues/146#issuecomment-507862148 fixes the issue.
Apologies on the delay, yes moving it to the top did correct my issue.
Issue description or question
I'm getting a
Error: EEXIST: file already exists, mkdir '/components/loading/dist/min'
though it does remove it on the next pass. This happened after upgrading from 2.0.0. Seems to be on a folder in the output folder.Webpack Config
Environment
Run:
npx envinfo --system --binaries --npmPackages clean-webpack-plugin,webpack