Skip to content

Commit

Permalink
fix issue where electron doesn't open with electron:dev task
Browse files Browse the repository at this point in the history
"react-scripts start" launches a dev server on IPv4.
With Node 17+ on Windows, "wait-on http://localhost:3000" tries to connect over IPv6 and fails.
By changing the command to "wait-on http://127.0.0.1:3000", wait-on will make an IPv4 request and succeed, allowing electron to open.

Here's a related thread about other people running into this issue: jeffbski/wait-on#109
  • Loading branch information
Macil committed Oct 13, 2022
1 parent 5dc6ee2 commit b1fe4d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -183,7 +183,7 @@ app.on('activate', () => {
```json
"scripts": {
"postinstall": "electron-builder install-app-deps",
"electron:dev": "concurrently \"cross-env BROWSER=none yarn start\" \"wait-on http://localhost:3000 && tsc -p electron -w\" \"wait-on http://localhost:3000 && tsc -p electron && electron .\"",
"electron:dev": "concurrently \"cross-env BROWSER=none yarn start\" \"wait-on http://127.0.0.1:3000 && tsc -p electron -w\" \"wait-on http://127.0.0.1:3000 && tsc -p electron && electron .\"",
"electron:build": "yarn build && tsc -p electron && electron-builder",
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -28,7 +28,7 @@
"build": "react-scripts build",
"test": "react-scripts test",
"postinstall": "electron-builder install-app-deps",
"electron:dev": "concurrently \"cross-env BROWSER=none yarn start\" \"wait-on http://localhost:3000 && tsc -p electron -w\" \"wait-on http://localhost:3000 && tsc -p electron && electron .\"",
"electron:dev": "concurrently \"cross-env BROWSER=none yarn start\" \"wait-on http://127.0.0.1:3000 && tsc -p electron -w\" \"wait-on http://127.0.0.1:3000 && tsc -p electron && electron .\"",
"electron:build": "yarn build && tsc -p electron && electron-builder",
"eject": "react-scripts eject"
},
Expand Down

0 comments on commit b1fe4d0

Please sign in to comment.