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

Mac M1 #121

Open
heffernan111 opened this issue Mar 29, 2022 · 6 comments
Open

Mac M1 #121

heffernan111 opened this issue Mar 29, 2022 · 6 comments

Comments

@heffernan111
Copy link

Wait-on does not seem to work with mac m1, see package.json relevant parts below.

The app will load in the browser but the electron app will never appear. Work fine on the previous macbook and works fine if I change electron:start to , "electron:start": "concurrently -k "cross-env BROWSER=none yarn start" "electronmon ."", where the app then loads blank and I refresh manually.

"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"electron:start": "concurrently -k "cross-env BROWSER=none yarn start" "wait-on http://localhost:3000 && electronmon ."",
"electron:package:mac": "yarn build && electron-builder -m -c.extraMetadata.main=build/electron.js",
"electron:package:win": "yarn build && electron-builder -w -c.extraMetadata.main=build/electron.js",
"electron:package:linux": "yarn build && electron-builder -l -c.extraMetadata.main=build/electron.js"
},
"devDependencies": {
"concurrently": "^7.0.0",
"cross-env": "^7.0.3",
"electron": "^18.0.0",
"electron-builder": "^22.14.5",
"electronmon": "^2.0.2",
"wait-on": "^6.0.1"
},

@heffernan111
Copy link
Author

I also tried with 127.0.0.1:3000 instead, same issue.

@reksc
Copy link

reksc commented Apr 15, 2022

I have a mid 2015 mac and came here with the same issue. I did a massive brew update yesterday which also bumped node and yarn. Maybe it's not related to M1 actually?

@essial
Copy link

essial commented Jul 24, 2022

Same issue, doesn't work at all. M1 mac.

@permpkin
Copy link

Temporary workaround for this I found was to add waitFor into the electron script e.g.
Add the below to your createWindow method.

async function createWindow() {

  // wait for localhost:3000 to
  // become available.
  if (isDev) {
    const waitOn = require('wait-on');
    await waitOn({
      resources: [
        'http://localhost:3000'
      ],
      validateStatus: function (status) {
        return status >= 200 && status < 300; // default if not provided
      }
    });
  }

@TrueWill
Copy link

We're running into this in a Jest test scenario too - on an M1 await waitOn({resources: ['tcp:localhost:3000']}); is not returning, while it works on other machines (and that port is in use).

@metcoder95
Copy link

Change it to tcp:127.0.0.1:3000. By default, the DNS resolver of the machine will return IPv6 first. If the service is not aware and listening to both IPv, it will fall into a timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants