Fix temp file ENOENT crash (#8615) #10153
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #8615
↪️ Pull Request
This should fix a crash that seems to happen to many people, including myself - see issue #8615, #8571 etc.
Full disclosure: I haven't had much success building Parcel and running tests and I really just needed this fixed ASAP, so I just tested this by editing the compiled scripts and then applying the fixes back to the original source file. There might be some issues I'm overlooking, so any help with testing and other necessary steps will be much appreciated. I haven't really seen a good fix anywhere in this repository (that doesn't cause any other issues down the road).
🚨 Test instructions
For me, the original bug happens on Windows using Parcel 2.15.0, while using the Pug preprocessor. All that's needed to crash Parcel is to run a dev script, make a small change to index.pug, save and hot-reload, make another small change, save again and after the 3rd or 4th save, it crashes pretty reliably, throwing the ENOENT error many have described in the mentioned issue. After applying my fix, it does not happen anymore and everything works well.
✔️ PR Todo