-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
createWriteStream: Ignore error in fs.unlinkSync #8616
base: v2
Are you sure you want to change the base?
Conversation
8ac939f
to
674a66b
Compare
Benchmark ResultsKitchen Sink ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
React HackerNews ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. AtlasKit Editor ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
@mischnic I was having similar issues, and after applying your fix as a yarn patch it got better but still got this error:
Does this solution work perfectly or still has some issues? |
No, that should not be happening. Previously, it would have tried to delete |
@mischnic I havent checked Parcel source that much, but perhaps there are multiple threads running (idk if Parcel is multi-threaded), and something deleted that file already previously? Seems like some kind of race condition. Now after your intial fix it was way harder for me to get any errors, but still managed to get this one 😅 |
That is exactly the reason why we added this atomic write stream in the past. |
@mischnic could we please get a fix on this? It’s been multiple months and I’ve been suffering nonstop since. |
For what it's worth,I have the same problem as @partyvaper above, adding try/catch over unlink fixes this exact issue (I'm on Windows), but then I see another frequently (not always):
The good news is this new error (that I didn't have before the try/catch) doesn't break the whole parcel process so I can trigger any change (save a file for example, I use the watch command) and it works again. Not super, but better. |
Hello guys, I am experiencing the same issue, posted the error here: #8571 |
Looks like Node's
fs.createWriteStream
sometimes fails to create a file at all, which would mean thatunlinkSync()
tries to delete a file that doesn't exist resulting in the error. (Or maybe there's a writestream error after the file was renamed?)I don't know though why it happens only rarely on Windows and apparently nowhere else.
Closes #8571
Closes #8615