DEV Community

Discussion on: Electron Apps Made Easy with Create React App and Electron Forge

Collapse
 
brittanynavin profile image
Brittany Navin

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
Enter fullscreen mode Exit fullscreen mode

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 .",
Enter fullscreen mode Exit fullscreen mode
Collapse
 
bladnman profile image
Matt Maher

Great debugging here. Saved me.

Collapse
 
toggenation profile image
James McDonald

Thanks Brittany,

Was getting the exact same issue trying to start electron.

Appreciate the post :)