Fix EPERM errors on Windows when using the --save-bundle and --clean-dir CLI arguments#364
Fix EPERM errors on Windows when using the --save-bundle and --clean-dir CLI arguments#364aryaemami59 wants to merge 1 commit intoai:mainfrom
EPERM errors on Windows when using the --save-bundle and --clean-dir CLI arguments#364Conversation
|
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
7653bc8 to
1cf74ef
Compare
1cf74ef to
5acb798
Compare
5acb798 to
72a61b1
Compare
72a61b1 to
9b6b264
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.
9b6b264 to
af18b2e
Compare
Overview
When using the
--save-bundleand--clean-dirCLI arguments, we can get intermittentEPERMerrors on Windows. My assumption is that there is probably some sort of race condition involved. The issue originates from thebeforefunction 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 themaxRetriesoption to thefs.rmandfs.rmdirfunctions seems to resolve this issue.This PR:
maxRetriesoption tofs.rmandfs.rmdirfunctions to mitigateEPERMerrors on Windows when using the--save-bundleand--clean-dirCLI arguments.