-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix EPERM
errors on Windows when using the --save-bundle
and --clean-dir
CLI arguments
#364
base: main
Are you sure you want to change the base?
Conversation
I'm really afraid to solve issues by trying multiple times. It could make even worse. Also releasing new versions is hard. I prefer to wait for proper solution. |
@ai This is definitely a big part of the solution. I just tried it, I used to get the |
I’m afraid that we are hiding some dangerous error, which could lead to something bad (instead of looking for it and fixing it). If you want a quick solution, maybe try to add |
@ai I did a bunch of |
Maybe this core runs in the same time? size-limit/packages/webpack-why/index.js Lines 41 to 51 in d0d681d
Try to replace |
@ai Interesting... Let me look into it and see. I'm only using |
I tried a bunch of things, nothing else seems to fix it but this, though I'm open to suggestions :) |
Very likely that it is not a Size Limit issue, but Linux one. Linux has option to set maximum open files limit. Sometimes this limit is too small. |
Try to find a way to increase the limit and increase it. There is an option, I am just on the way and can't give exact line. |
Not sure I understand, the issue I'm experiencing is happening on Windows, not Linux. And as far as there being a limit on how many files can be opened at the same time, wouldn't it be easier to figure out a way to workaround/fix it from within the library than fiddle with the internal settings of the OS? |
|
fa5ba94
to
6a6d526
Compare
dccf975
to
7653bc8
Compare
- When using the `--save-bundle` and `--clean-dir` CLI arguments, we can get intermittent `EPERM` errors on Windows. Passing in the `maxRetries` option to `fs.rm` and `fs.rmdir` functions seems to resolve this issue.
7653bc8
to
1cf74ef
Compare
Overview
When using the
--save-bundle
and--clean-dir
CLI arguments, we can get intermittentEPERM
errors on Windows. My assumption is that there is probably some sort of race condition involved. The issue originates from thebefore
function of the'@size-limit/webpack'
plugin. I'm not sure if there is potential for more errors, I will try and take a closer look later but for now, adding themaxRetries
option to thefs.rm
andfs.rmdir
functions seems to resolve this issue.This PR:
maxRetries
option tofs.rm
andfs.rmdir
functions to mitigateEPERM
errors on Windows when using the--save-bundle
and--clean-dir
CLI arguments.