Open dgkimpton opened 4 years ago
It's probably because two thread try to write to the cache at the same time and renaming a file fails if the new name 8ca9278422d5f7bdd56853b2d8203c.v8
already exists.
Related: #4955, though this is about the cache and not the distdir...
I get the same error every time I try to build using nightly-420
. It was working fine in nightly-286
, now I can not build anymore :(
@parcel/cache: EPERM: operation not permitted, rename '.parcel-cache2551fcab67e8d70c9e78e7663604f616.v8.16584.0.8' -> '.parcel-cache2551fcab67e8d70c9e78e7663604f616.v8'
I want to mention that I get this error even though I build with --no-cache
:
parcel build src/index.html --no-cache --no-scope-hoist --no-source-maps
Reverting back to nightly-286
fixes the problem. I constantly tried to update to newer nightlies, but 286
was the last one that is still working fine for my project.
So parcel@2.0.0-nightly.286
works but parcel@2.0.0-nightly.287
doesn't?
Are you sure that all Parcel packages are on the same version (e.g. if you're using a parcelrc)?
AFAICT, this is the difference between 286 and 287: https://github.com/parcel-bundler/parcel/compare/1d216a94...4338719e. Nothing suspicious.
So parcel@2.0.0-nightly.286 works but parcel@2.0.0-nightly.287 doesn't? Haven't tried with
287
, I remember trying with something 300-ish and it didn't work, and now it still doesn't work with 420. Maybe I can try doing a binary-search through versions and see which is the first one that breaks.Are you sure that all Parcel packages are on the same version (e.g. if you're using a parcelrc)?
I don't use a .parcelrc. I tried updating to 420, remove the .parcel-cache, build, it fails with that error plus some other errors (something related to V8 Handler and some warnings related to source-maps missing, even though I build with --no-source-maps
.
Got the same issue after updating next (2.0.0-beta.1) to nightly (2.0.0-nightly.425).
I tried again updating to nightly.433, same error. I even deleted before node_modules and all caches, still building doesn't work...
console: (node:14676) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 17 error listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
console: (node:14676) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 17 close listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
@parcel/cache: EPERM: operation not permitted, rename '.parcel-cache15d17aa12a6997112f0d035735b688fb.v8.14676.0.5' -> '.parcel-cache15d17aa12a6997112f0d035735b688fb.v8'
I just solved it, I uninstall parcel, npm uninstall pacel, then installed it again, npm install parcel-bundler --save-dev
Continuing the discussion from #5965:
@mischnic I prepared a repo for you resulting in the EPERM
error (though not 100% of the time, but around 60% of the time everytime).
To reproduce:
git clone https://github.com/lookmom/nohands.git
to your favorite testing folder (exact commit)yarn install
it (you need yarn, it has some workspaces)yarn start
itI have:
@krnlde Could it be caused by cmder? I am having the same issue, and I am using cmder as well. (I have downgraded parcel, so I cannot try now.)
Possibly. I'll try in plain cmd
Nope, it took a lot longer to reproduce but still:
Windows Terminal Preview (cmd)
What I do to reproduce is trying to modify the contents of the file, sometimes add a statement like color: gray;
, sometimes remove it, to force the bundler to recompile (don't need try to change while recompiling). Let it recompile and sometimes in this process it fails with the above error (~ every 1 out of 5).
EDIT: it doesn't seem to happen ever with WSL Ubuntu shell. Probably windows specific though a showstopper since the (sym-)linked packages in node_modules from Linux cannot be resolved in Windows (needed for typescript code completions in the IDE)
@mischnic did you try it in the meantime? Do you have a windows machine to test it on? Any news? This issue is annoying to a point where I consider to reconsider the bundler choice.
@mischnic did you try it in the meantime? Do you have a windows machine to test it on? Any news? This issue is annoying to a point where I consider to reconsider the bundler choice.
Are there any feature of parcel 2 that you need? If not, I suppose you can revert back to parcel 1 and wait for this to be resolved. (That is what I did.)
@SCLeoX: Other than that it's promoted as "production ready", "gets more frequent updates" and "is generally better"? No not really. I guess so.
Sorry for the late response. I can indeed reproduce it with https://github.com/parcel-bundler/parcel/issues/5036#issuecomment-815808270
How do we continue?
I'm having this error as well, it's annoying. Probably I'm going to change my bundler choice...
For me, the error occurs way too rarely with the reproduction above to be able to debug it. I just no error at all after at least 5 minutes of trying.
color: a;
-> color: b
-> color: a
, does the error happen after changing it back)?I do think that this call is the failing operation: https://github.com/parcel-bundler/parcel/blob/a3679960728140a609ff29d98bf069e15d773305/packages/core/fs/src/NodeFS.js#L79
Could it have something to do with (non-)atomic saves that possibly are handled differently in different OSes?
This is definitely specific to Windows, and I did test this on Windows
Update. Having "parcel": "2.0.0-nightly.649",
and "@parcel/transformer-sass": "2.0.0-nightly.651",
I didn't get the error for a whole workday. Can anyone confirm?
Update. Having
"parcel": "2.0.0-nightly.649",
and"@parcel/transformer-sass": "2.0.0-nightly.651",
I didn't get the error for a whole workday. Can anyone confirm?
Doesn't work for me π₯! but please don't close the issue, changing the version isn't a way to fix a problem
For me, the error occurs way too rarely with the reproduction above to be able to debug it. I just no error at all after at least 5 minutes of trying.
* Do you have to restart Parcel to get it to trigger? (= does it only happen on the first change after the initial build) * Does it happen at all when there's a cache entry for the file contents (for example with `color: a;` -> `color: b` -> `color: a`, does the error happen after changing it back)?
I do think that this call is the failing operation:
So should we delete this line ?
I have been using parcel v2 on my Mac for about six weeks and one of my colleagues has just joined the project and is using win 10.
He straight away got this problem on his machine. I tried to reproduce on Mac and had no problems.
So I have just tried in my bootcamp partition, which was a bare windows install. I've installed node.js and cloned my project, run npm install and npm run watch and right away I get the same error.
I really need help with fixing this as this is a big problem and I don't think downgrading is a viable solution.
Which version are you using? I couldn't reproduce it anymore with nightly 688+
I have been using this build for my dev: "parcel": "^2.0.0-beta.2"
However, I just uninstalled parcel and installed "parcel": "^2.0.0-beta.3.1" and have the same problems with both builds. I run a clean script between any build or watch attempts which deletes the cached files
Just an addtional observation. I get the following error after the above EPERM error when I run npm run build:
Γ Build failed. @parcel/core: Failed to resolve '/testem.js' from './node\_modules/console-browserify/test/static/index.html' @parcel/resolver-default: Cannot load file '../../../../testem.js' in './node_modules/console-browserify/test/static'. Did you mean ../../.testem.json? Parcel is shutting down...
However, if I npm run watch I get a similar error referencing different files:
Γ Build failed. @parcel/core: Failed to resolve '/bundle.js' from './node\_modules/vm-browserify/example/run/index.html' @parcel/resolver-default: Cannot load file '../../../../bundle.js' in './node_modules/vm-browserify/example/run'. Did you mean ../../index.js? Did you mean ./bundle.js? Parcel is shutting down...
I have been using this build for my dev: "parcel": "^2.0.0-beta.2"
However, I just uninstalled parcel and installed "parcel": "^2.0.0-beta.3.1" and have the same problems with both builds. I run a clean script between any build or watch attempts which deletes the cached files
Could you try a parcel version >= 2.0.0-nightly.688
and see if it persists?
Yes sure I'll try now
With 2.0.0-nightly.688 I no longer get the EPERM error with either watch or build, but I do get another error, which looks like it's pointing at an error in my code perhaps? See below.
Γ Build failed. @parcel/transformer-js: Browser scripts cannot have imports or exports. Use a Githubissues.
π bug report
I get an error when using the latest @nightly that I don't get using the @next.
Strangely Parcel goes ahead and builds anyway so I'm not quite sure what this is about. Both files mentioned in the error exist, so it maybe fails to rename and copies instead?
It isn't 100% repeatable - exactly once it succeeded without the error - race condition?
π Configuration (.babelrc, package.json, cli command)
rm -rf .parcel-cache/* dist/* && parcel build --no-source-maps *.html src/**/*.html
π€ Expected Behavior
No error.
π― Current Behavior
π Your Environment
Running the command in git-bash hosted inside vs-code.
I'm afraid I'm not quite sure what to include to help debug this one without copying across my entire project. Let me know if you want anything specific or something testing.