parcel: Unable to build or start new project using Parcel 2
π bug report
Attempting to parcel build index.html or parcel index.html fails completely with an ENOENT error.
π Configuration (.babelrc, package.json, cli command)
Repro repo is here: https://github.com/AKPWebDesign/parcel-build-issue
π€ Expected Behavior
I should be able to build and start my project.
π― Current Behavior
I am unable to build and start my project.
Error Details:
yarn run v1.22.4
$ parcel index.html
βΉοΈ Server running at http://localhost:1234
Bundling...
Packaging index.html...
Optimizing index.html...
@parcel/workers: ENOENT: no such file or directory, rename '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob.6767.1.0' -> '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob'
Error: ENOENT: no such file or directory, rename '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob.6767.1.0' -> '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob'
at Object.renameSync (fs.js:660:3)
at WriteStream.<anonymous> (/AKPWebDesign/parcel-build-issue/node_modules/@parcel/fs/lib/NodeFS.js:74:42)
at WriteStream.emit (events.js:321:20)
at emitCloseNT (internal/streams/destroy.js:69:8)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
Packaging index.html...
Optimizing index.html...
@parcel/workers: ENOENT: no such file or directory, rename '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob.6767.2.0' -> '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob'
Error: ENOENT: no such file or directory, rename '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob.6767.2.0' -> '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob'
at Object.renameSync (fs.js:660:3)
at WriteStream.<anonymous> (/AKPWebDesign/parcel-build-issue/node_modules/@parcel/fs/lib/NodeFS.js:74:42)
at WriteStream.emit (events.js:321:20)
at emitCloseNT (internal/streams/destroy.js:69:8)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
Packaging index.html...
Optimizing index.html...
@parcel/workers: ENOENT: no such file or directory, rename '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob.6767.3.0' -> '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob'
Error: ENOENT: no such file or directory, rename '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob.6767.3.0' -> '/AKPWebDesign/parcel-build-issue/.parcel-cache/c2/28ddc1749b7d8aa1ce360162a8804e.blob'
at Object.renameSync (fs.js:660:3)
at WriteStream.<anonymous> (/AKPWebDesign/parcel-build-issue/node_modules/@parcel/fs/lib/NodeFS.js:74:42)
at WriteStream.emit (events.js:321:20)
at emitCloseNT (internal/streams/destroy.js:69:8)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
Packaging index.html...
Optimizing index.html...
[ repeat ad infinitum... ]
π» Code Sample
https://github.com/AKPWebDesign/parcel-build-issue
π Your Environment
I tested this repo using both parcel@next and parcel@nightly, on both Ubuntu (using Windows Subsystem for Linux) and macOS Catalina, receiving the same error on both.
| Software | Version(s) |
|---|---|
| Parcel | ^2.0.0-alpha.3.2, ^2.0.0-nightly.270 |
| Node | v12.x |
| npm/Yarn | yarn 1.22.4 |
| Operating System | Ubuntu 18.04.2 LTS (WSL 4.4.0-18362-Microsoft) / macOS Catalina (10.15.3) |
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 17 (6 by maintainers)
Commits related to this issue
- ensure to not rename tmp file twice With the change in #4552 close can be called twice, therefore the second rename will fail. Only executing it once prevents it. Closes #4614 — committed to garthenweb/parcel by garthenweb 4 years ago
- ensure to not rename tmp file twice With the change in #4552 close can be called twice, therefore the second rename will fail. Only executing it once prevents it. Closes #4614 — committed to garthenweb/parcel by garthenweb 4 years ago
I had the same issue. With the mentioned change in #4552 the close event can get fired twice, therefore the second rename fails. I created a PR which fixes it for me.
Yeah, looks like installing
parcel@2.0.0-nightly.266(the next oldest parcel version that yarn shows me) resolves this.Interesting to know that all three are working on your machine⦠I thought at first that it could be an issue with WSL, but then I tried on macOS and encountered the same problem.
I think itβs rather because the error bubbled up.
@parcel/workersitself doesnβt usefs.createWriteStream