Skip to content
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

build freeze on 1.9.2 #1583

Closed
coffeeowl opened this issue Jun 19, 2018 · 17 comments
Closed

build freeze on 1.9.2 #1583

coffeeowl opened this issue Jun 19, 2018 · 17 comments

Comments

@coffeeowl
Copy link

πŸ› bug report

build freeze (as reported in #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.

🌍 Your Environment

Software Version(s)
Parcel 1.9.2
Node 10.1.0
npm/Yarn 6.1.0
Operating System Linux 4.16.13-1-ARCH
@DeMoorJasper
Copy link
Member

This seems unrelated to any recent updates, this seems to be originating from the hmr websocket

@coffeeowl
Copy link
Author

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.

@coffeeowl
Copy link
Author

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.

@DeMoorJasper
Copy link
Member

Would be nice to detect corrupt cache files, not sure how to implement this though (without performance penalty)

Sent with GitHawk

@sonaye
Copy link

sonaye commented Jun 19, 2018

I'm facing the same issue @1.9.2, had to add "prestart": "rm -rf .cache", as a temp. workaround.

@coffeeowl
Copy link
Author

coffeeowl commented Jun 20, 2018

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.

@DeMoorJasper
Copy link
Member

@coffeeowl Could you create a reproducible example?

@coffeeowl
Copy link
Author

For freeze or cache issue? Freeze - I don't think so, as for the cache issue - I'll try.

@DeMoorJasper
Copy link
Member

Doesn't matter we need to fix both anyways

@Hammster
Copy link
Contributor

Hammster commented Jun 21, 2018

@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.

maxConcurrentCallsPerWorker: 10,

I am not sure if this is diffrent bug though that OP has, but the result is the same.

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Jun 21, 2018

@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

@DeMoorJasper
Copy link
Member

Should be fixed in latest version as workerfarm has been fixed.

@Muini
Copy link

Muini commented Jul 28, 2018

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 ?

@tmchng
Copy link

tmchng commented Aug 7, 2018

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.

@DeMoorJasper
Copy link
Member

Please feel free to open up a new issue with your findings @tmchng

@BBlackwo
Copy link

BBlackwo commented Aug 10, 2018

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...

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Aug 10, 2018

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

@parcel-bundler parcel-bundler locked as resolved and limited conversation to collaborators Aug 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants