build freeze (as reported in https://github.com/parcel-bundler/parcel/issues/1537) still happens, luckily not as often (at least on Heroku) as it was before and there are some errors being thrown
โณ Building assign.js...
(node:31252) UnhandledPromiseRejectionWarning: Error: socket hang up
at createHangUpError (_http_client.js:313:15)
at Socket.socketOnEnd (_http_client.js:416:23)
at Socket.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1081:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:31252) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:31252) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:31218) UnhandledPromiseRejectionWarning: Error: socket hang up
at createHangUpError (_http_client.js:313:15)
at Socket.socketOnEnd (_http_client.js:416:23)
at Socket.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1081:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:31218) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:31218) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:31218) UnhandledPromiseRejectionWarning: Error: socket hang up
at createHangUpError (_http_client.js:313:15)
at Socket.socketOnEnd (_http_client.js:416:23)
at Socket.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1081:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:31218) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
nothing happens after that, build process still gets stuck as before.
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.2
| Node | 10.1.0
| npm/Yarn | 6.1.0
| Operating System | Linux 4.16.13-1-ARCH
This seems unrelated to any recent updates, this seems to be originating from the hmr websocket
I see. still, I definitely observed a build freeze on Heroku (though it was 1.9.0) where of course we don't run parcel in watch mode.
BTW, it seems when this HMR problem happens it leaves .cache in a bad state, just restarting watch process doesn't help - even though build succeeds, application doesn't load due to some random errors (looks like some garbage code were generated). So, cache has to be removed.
Would be nice to detect corrupt cache files, not sure how to implement this though (without performance penalty)
Sent with GitHawk
I'm facing the same issue @1.9.2, had to add "prestart": "rm -rf .cache", as a temp. workaround.
And I can confirm that build freeze issue is still present in 1.9.2, happened a couple of times today. Also, corrupted builds happen pretty often, I have to remove .cache on like every 3rd build.
@coffeeowl Could you create a reproducible example?
For freeze or cache issue? Freeze - I don't think so, as for the cache issue - I'll try.
Doesn't matter we need to fix both anyways
@DeMoorJasper Example Repo: https://github.com/Hammster/parcel-1.9.x-freeze
This is a reproduction of the bug, it happens when you've got a lot of vue components, maybe this is generally the case when many files get processed at once.
I can fix it in our project by changing maxConcurrentCallsPerWorker to a value between 1 and 3 in this line.
I am not sure if this is diffrent bug though that OP has, but the result is the same.
@Hammster Tbh in environments like heroku parcel probably only gets 1 thread, so it should probably not even start using a worker.
But the overload issue is a known issue, see #1587 and #1595
Should be fixed in latest version as workerfarm has been fixed.
I personnaly still have the freezing issue...
Windows 10
Parcel v1.9.7 (tried different versions, no results)
Node v8.11.3
npm v6.0.0
yarn v1.7.0
I tried to set variable env PARCEL_MAX_CONCURRENT_CALLS and/or PARCEL_WORKERS to different values, no success. (with and without no cache, no hmr etc)
It's on a vue project, with node-sass too.
I can successfully start the dev (not the build) if I comment most of my includes, then it's building successfully, and I can put them back one by one until I got everything working.
I have a dual boot with a linux (based on ubuntu) and I have the exact same problem. The env is the same except for the node version. So I don't think it's an OS issue.
Should I create a new issue ?
I also continued to have freeze issues and traced the problem to WorkerFarm.js.
There's an option called warmWorkers that is hard-coded to true inside WorkerFarm.js. My build no longer freezes after I set it to false. I have not had the time to investigate why.
I ended up adding the following line to package.json postinstall script so set warmWorkers to false every time I install parcel:
sed -i 's/warmWorkers: true/warmWorkers: false/' ./node_modules/parcel-bundler/src/workerfarm/WorkerFarm.js
Update: my issue seems similar to #1836 and can be reproduced by trying to bundle only html+sass files. So I've made a comment there.
Please feel free to open up a new issue with your findings @tmchng
I've got the same issue as @Muini. If I comment out the @imports on the file it's freezing on, build, then go back and uncomment the @imports and build again I can get it working.
Setting the env variable PARCEL_WORKERS=1 and setting warmWorkers: false fixes my issue temporarily but annoying still. On OSX had to add '' at the start, so:
sed -i '' 's/warmWorkers: true/warmWorkers: false/' ./node_modules/parcel-bundler/src/workerfarm/WorkerFarm.js
My build looks like this:
parcel build src/file1.scss src/file2.scss src/file3.scss src/file4.scss
On parcel v1.9.7.
It hangs on: Building file4.scss...
It appears to be an issue with node-sass not being able to handle multiple async requests like mentioned here: #1847
You can try out the PR #1847 , it should resolve your issue.
Let's move discussion for sass freezing here: #1836
Most helpful comment
I personnaly still have the freezing issue...
Windows 10
Parcel v1.9.7 (tried different versions, no results)
Node v8.11.3
npm v6.0.0
yarn v1.7.0
I tried to set variable env PARCEL_MAX_CONCURRENT_CALLS and/or PARCEL_WORKERS to different values, no success. (with and without no cache, no hmr etc)
It's on a vue project, with node-sass too.
I can successfully start the dev (not the build) if I comment most of my includes, then it's building successfully, and I can put them back one by one until I got everything working.
I have a dual boot with a linux (based on ubuntu) and I have the exact same problem. The env is the same except for the node version. So I don't think it's an OS issue.
Should I create a new issue ?