parcel
parcel copied to clipboard
Parcel crashes with `Error: ENOENT: no such file or directory,` when using `--detailed-report`
🐛 bug report
The following command: parcel build --detailed-report 40 src/main.ts
makes parcel crash
🎛 Configuration (.babelrc, package.json, cli command)
{
"devDependencies": {
"parcel": "nightly"
},
"targets": {
"newest": {
"engines": {
"browsers": "last 1 firefox version"
}
}
},
"scripts": {
"build": "parcel build --detailed-report 40 src/main.ts"
}
}
🤔 Expected Behavior
Parcel should build successfully
😯 Current Behavior
[Error: ENOENT: no such file or directory, open '/private/tmp/parcel/dist/main.js'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/private/tmp/parcel/dist/main.js'
}
💁 Possible Solution
Dunno 🤷♂️
🔦 Context
Updated my dependencies to figure out if it fixes https://github.com/babel/babel/issues/14345.
After installing process
and figuring out that my builds randomly fail because I'm missing
"alias": {
"process": {
"global": "process"
}
},
In my package.json
I got this error and narrowed it down to --detailed-report
💻 Code Sample
Run yarn install
and yarn build
🌍 Your Environment
Software | Version(s) |
---|---|
Parcel | 2.0.0-nightly.1008+493fda27e |
Node | v17.6.0 |
npm/Yarn | 3.2. |
Operating System | macOS 12.2 (21D49) |
Got the same Issue on Windows 10, node v17.8.0, npm 8.5.5, parcel 2.4.0 & 2.4.1. I also use --detailed-report --reporter @parcel/reporter-bundle-analyzer
Hint: The build itself works fine, just the error appears instead of a detailed report.
The detailed report uses source maps to determine the file sizes of each file contained within a bundle. This could potentially happen if a source map refers to a file that doesn't actually exist. I guess we should check that and gracefully fall back somehow?
The project is entirely clean though. No old cache files. The development mode works fine. It's just the build that throws an error. I'll try to reproduce it with a demo project and send you the code.
@kai-dorschner-twinsity Did you try the reproduction project that I attached as .zip in the original issue body? It might be enough.
This is probably be related to https://github.com/parcel-bundler/parcel/issues/7813#issuecomment-1085012123 if /private/tmp/parcel/dist/main.js
isn't fully written to disk yet when the report tries to read it back.
@kai-dorschner-twinsity Did you try the reproduction project that I attached as .zip in the original issue body? It might be enough.
I tried it now, breaks as expected.
Lmao, what??
I just upgraded to 2.0.0-nightly.1035+80c728cef
and it appears to be fixed??
It happens on 2.0.0-nightly.1008+493fda27e
where the zip file's lockfile is but doesn't happen in my production project anymore which is on 1035 if I don't find further issues.
I tried to upgrade the reproduction but got
daniel@Daniels-MacBook-Pro parcel % yarn install
➤ YN0000: ┌ Resolution step
➤ YN0032: │ @parcel/watcher@npm:2.0.5: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ node-addon-api@npm:3.2.1: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ msgpackr-extract@npm:1.1.0: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ lmdb@npm:2.2.4: Implicit dependencies on node-gyp are discouraged
➤ YN0013: │ node-gyp-build@https://github.com/kriszyp/node-gyp-build.git#commit=c9952cb77e89d2cd8b6c2d4d056a06d41834b305 can't be found in the cache and will be fetched from GitHub
➤ YN0032: │ nan@npm:2.15.0: Implicit dependencies on node-gyp are discouraged
➤ YN0035: │ chownr@npm:^2.0.0: The remote server failed to provide the requested resource
➤ YN0035: │ Response Code: 404 (Not Found)
➤ YN0035: │ Request Method: GET
➤ YN0035: │ Request URL: https://registry.yarnpkg.com/chownr
➤ YN0000: └ Completed in 16s 419ms
➤ YN0000: Failed with errors in 16s 425ms
And don't care about debugging that so it might be fixed or something makes that I don't hit it anymore in my prod repo. Would love to hear what could have fixed it and if you also don't have it anymore on 1035 @kai-dorschner-twinsity
In my project I use Parcel 2.4.1
where the above error appears.
Ok and if you set it to 2.0.0-nightly.1035+80c728cef
instead of 2.4.1, does it still occur?
Kai, have you checked the reproduction project that I attached as a zip to the original issue? I think it might suffice.
4 apr. 2022 kl. 10:04 skrev Kai Dorschner @.***>:
The project is entirely clean though. No old cache files. The development mode works fine. It's just the build that throws an error. I'll try to reproduce it with a demo project and send you the code.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
Hi, I often get this error when using parcel watch
. During the watch (run with command npx parcel watch --dist-dir ../MyWebApp/wwwroot/SaasScripts --no-cache
) , it randomly fails with this error:
Sometimes the only solution is to do git clean -fdx
and reinstall all npm packages/rebuilt everything, which is very frustrating and time-consuming...
I'm on parcel 2.7.0
Same issue for me. The bigger the code-base gets the worse this problem becomes.
Win 11, Git 2.38.1.windows.1, node v18.11.0, npm 8.19.2, parcel 2.7.0
I'm using workspaces defined as follows:
"workspaces": [
"src/*"
],
This is my start command: parcel serve ./src/app/index.html --log-level info --open --port 5501
Edit: My coworkers can confirm it happens on MacOS, too
Edit 2: This is what we see
Any news on that issue?
I've had the same problem for days and can't find a solution. Very frustrating, hardly possible to work normally
Same- I've had this problem too. I feel let down by Parcel- it's very frustrating, and I am not very happy with Parcel. Please, please fix this issue- I can't do anything without constantly rebuilding manually. What's the point of parcel watch
if it builds once and throws an error?
@IMGROOT2 have you tried removing --detailed-report
and using the latest nightly version?
And specifically:
- if it says
syscall: 'open',
then this is the right issue. Though this should be fixed now with https://github.com/parcel-bundler/parcel/pull/8194 - if it says
syscall: 'unlink'
, then it's https://github.com/parcel-bundler/parcel/issues/8615
if it says syscall:
'unlink'
, then it's https://github.com/parcel-bundler/parcel/issues/8615
This is my issue. It's quite random, however. Some days, everything will go smoothly, and on other days, it'll crash after building once.
Same here!
Same issue
This is my run script: "dev": "tsc --noEmit && parcel src/index.html --no-cache --open"
Same here!
same problem for months now... so annoying
I have the same issue.
Same issue on Ubuntu, but not on Mac 🤷
Same problems here on windows that occurs very frequently...
Same on Windows 11. Using Node.js v20.9.0 and parcel 2.11.0 in a clean project.
node:internal/fs/sync:93
return binding.unlinkSync(path);
^
Error: ENOENT: no such file or directory, unlink 'C:\...\dist\index.html.41596.1o'
at Object.unlink (node:internal/fs/sync:93:18)
at Object.unlinkSync (node:fs:1853:17)
at WriteStream.<anonymous> (C:\...\node_modules\@parcel\fs\lib\index.js:1024:83)
at Object.onceWrapper (node:events:629:26)
at WriteStream.emit (node:events:526:35)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'unlink',
path: 'C:\\...\\dist\\index.html.41596.1o'
}
Also getting this error on W10. Not sure if it's relevant but I started the project on MacOS where I had zero issues.
Same here. Errors every few minutes on Windows 11. But with the same project on MacOS, not a single one. For months now..
For me the same on windows 11..
Is this project still alive? A basic feature like watch is not working and this issue is open for a year...