'Upgraded to macOS Monterey 12.3.1 and `playwright + electron` stopped working - how do I fix it?

We launch our Electron-based app like so:


  test.beforeAll(async() => {
    electronApp = await _electron.launch({
      args: [
        path.join(__dirname, '../'),
        '--disable-gpu',
        '--whitelisted-ips=',
        '--disable-dev-shm-usage',
      ]
    });
...

It used to work. Now the tests fail with this error message:

electron.launch: Timeout 30000ms exceeded.

      61 |     createDefaultSettings();
      62 |
    > 63 |     electronApp = await _electron.launch({
         |                                   ^

You can see the tests at https://github.com/rancher-sandbox/rancher-desktop . To reproduce:

Set up:

git clone https://github.com/rancher-sandbox/rancher-desktop.git
npm i

To reproduce:

npm run test:e2e


Solution 1:[1]

This might be related to the node issue on Monterey 12.3.1 that it is already running on the default port 5000.

Try disabling "Airplay receiver" like this post, it worked for me.

"System Preference" -> "Sharing" -> "Airplay receiver"

Why nodeJS is not working on macOS Monterey?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Linju