I'm using the latest version (v6.0.0) of the wait-on npm package and my electron app didn't ever seem to pop up properly after my react app started up.
To investigate, I started up my react app on port 3000 and then cd'ed into my node_modules/wait-on/bin directory and ran ./wait-on tcp:3000 -v. I was getting the following error.
making TCP connection to 3000 ...
error connecting to TCP host:localhost port:3000 Error: connect ECONNREFUSED ::1:3000
My react app was 100% running on localhost:3000, as I could access it in my browser.
I stopped that running wait-on process and re-ran wait-on, passing my "localhost" IP into the wait-on command like so: ./wait-on tcp:127.0.0.1:3000 -v
Finally then got TCP connection successful to host:127.0.0.1 port:3000
So i modified the electron script in my package.json as follows:
"electron": "wait-on tcp:127.0.0.1:3000 && electron .",
I'm using the latest version (v6.0.0) of the
wait-on
npm package and my electron app didn't ever seem to pop up properly after my react app started up.To investigate, I started up my react app on port 3000 and then
cd
'ed into mynode_modules/wait-on/bin
directory and ran./wait-on tcp:3000 -v
. I was getting the following error.My react app was 100% running on localhost:3000, as I could access it in my browser.
I stopped that running
wait-on
process and re-ranwait-on
, passing my "localhost" IP into the wait-on command like so:./wait-on tcp:127.0.0.1:3000 -v
Finally then got
TCP connection successful to host:127.0.0.1 port:3000
So i modified the
electron
script in mypackage.json
as follows:Great debugging here. Saved me.
Thanks Brittany,
Was getting the exact same issue trying to start electron.
Appreciate the post :)