-
Notifications
You must be signed in to change notification settings - Fork 201
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
Error: net::ERR_CONNECTION_REFUSED on yarn build #26
Comments
Nevermind, closing this. I ripped out nodemon and replaced it with forever-monitor. The build process wasn't truly async, so nodemon was starting after puppeteer was trying to open the page in some cases. I changed my
And added:
|
I'm having the same issue, I guess the server isn't up when puppeteer tries to access it so it fails. Your solution didn't work for me unfortunately. |
Please check version 2.0.1. Has been merged an hour ago. This should fix it: |
@manuelbieh nop, now I can't build at all just by cloning the repository, installing dependencies as they are and running |
Will have to investigate a bit more. I reopened the issue. |
Thanks @manuelbieh , i'll look into that as well. Also I've noticed that running the start script but with production as the NODE_ENV doesn't generate the client build. |
The cause for this issue is that the server build is started in the build process to generate the static index.html but is then not properly terminated. So the Express server keeps running and, when you create another build, blocks the port. |
Sorry still seeing this error in Steps to reproduce:
and the build fails with
|
Damn 😕 |
Hm. Can't reproduce with a freshly cloned repo. Have you killed all possibly running node processes before pulling/cloning? I was able to create 5 consecutive builds without any issues. |
doublechecking now. |
By restarting my machine from scratch.... it ran first time, successfully. But. immediately doing
Looking at my activity monitor i can't see any node processes still running at all. |
(btw thank you so much - i know this must be a huge drag - i really appreciate the help) |
That's really annoying. I also had the same error for a long time and - at least on my machine - don't have it anymore after I made the change in I guess you're using a Mac, right? Which MacOS version? And which Node version? |
Man! Im truly sorry. This is such a great project - you deserve better thanks than me whining! Sorry ☕ 🌹 osx 10.14 / node v11.0.0 fwiw doing |
Will have to investigate further. Thanks for reporting! Timing, possible but not very likely. Will try to reproduce it on my Mac with Node 11 soon. |
Really very much appreciated. Thanks |
Been looking at this some more over the weekend and have made some nanoprogress :-) If I add a simple wait in ie
|
Weird 🤔 I will have a look at it! Thanks a lot! |
A colleague of mine told me the same. If that reliably solves this issue I will add it. Maybe my machine is just too fast (i7 HQ-series with 32 gigs of RAM ;)). Could you do me one more favor and check how low you can set the delay while still being able to create 5 consecutive builds without having that error? I don't want to increase the build time unnecessarily. Thanks! |
It's a total bodge but ¯_(ツ)_/¯ On my feeble MacBook, I get slightly inconsistent results, so it's hard to make it more fine-grained -
|
It doesn't really have anything to do with the build but with the time the (Express) server needs to start. My assumption is that the puppeteer process tries to access the server before the server has properly started. Maybe I should have a look at the Node event system and emit and subscribe to events to start puppeteer. Thanks for your help! |
Definitely agree
That sounds like a much, MUCH better idea than waiting and hoping! Though I guess if there's no convenient hook, it might not be crazy to try to access the server, then if that fails, wait and retry, then wait longer and rety etc?? So many thanks again. |
Hi @manuelbieh , Please check this point. If I comment the line inside build-ssr.ts line number 38 my production build is running perfectly.
|
When running
yarn build
, I'm getting this error:UnhandledPromiseRejectionWarning: Error: net::ERR_CONNECTION_REFUSED at http://localhost:8505
any idea what would cause this?
The text was updated successfully, but these errors were encountered: