question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error launching browser, Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds, The CDP port requested was 50877.

See original GitHub issue

Current behavior

Title: Error launching browser

0

Message:

Downloading and starting the Electron Starting Guide example from the docs, build the binaries , for example /out/electron-quick-start-win32-x64/electron-quick-start.exe and link that Electron Browser to Cypress Browsers list to execute the tests ( https://docs.cypress.io/guides/guides/launching-browsers#Launching-by-a-path ) Currently this causes the following error:

Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds.

This usually indicates there was a problem opening the Chrome browser.

The CDP port requested was <span class="ansi-yellow-fg">50877</span>.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:50877 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)

Stack trace:

Error: Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds.

This usually indicates there was a problem opening the Chrome browser.

The CDP port requested was 50877.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:50877
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)

    at get (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\lib\errors.js:988:15)
    at Object.throwErr [as throw] (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\lib\errors.js:1006:9)
    at C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\lib\browsers\protocol.js:106:21
    at tryCatcher (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromise0 (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:725:18)
    at _drainQueueStep (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:93:12)
    at _drainQueue (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\perivolg\AppData\Local\Cypress\Cache\7.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (internal/timers.js:461:21)

Desired behavior

Downloading and starting the Electron Starting Guide example from the docs, build the binaries for example /out/electron-quick-start-win32-x64/electron-quick-start.exe and link that Electron Browser to Cypress Browsers list to execute the tests ( https://docs.cypress.io/guides/guides/launching-browsers#Launching-by-a-path )

Test code to reproduce

Test taken from Cypress.io

const execa = require('execa')
const findBrowser = () => {
const browserPath =
    '{path_to}/electron-quick-start/out/electron-quick-start-win32-x64/electron-quick-start.exe'

return execa(browserPath, ['--version']).then((result) => {

    return {
        name: 'My.Electron.Browser',
        channel: 'stable',
        family: 'chromium',
        displayName: 'My.Electron.Browser',
        version: '1.0.0',
        path: browserPath,
        majorVersion: '1.0.0',
    }
})

}

module.exports = (on, config) => {
    return findBrowser().then((browser) => {
        return {
            browsers: config.browsers.concat(browser),
        }
    })
}

Versions

Cypress (latest) 7.5.0 Electron (latest) 13.1.2 (starting guide repo https://github.com/electron/electron-quick-start )

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
shanshanrjzcommented, Sep 7, 2021

macOS 10.15.5 , cypress 8.3.0 image

i have the same issue

1reaction
huangweilinagcommented, Aug 24, 2021

macOS 10.15.5 , cypress 8.3.0 image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress failed to make a connection to the ... - Stack Overflow
Runs on Electron and Edge but refuses to run on Chrome and throwing the attached error after unsuccessfully trying. My version of Chrome...
Read more >
cypress-io/cypress - Gitter
Error : Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds. This usually indicates there was...
Read more >
Bug #46624: mgr/dashboard: E2E: Failed to connect to Chrome
... Chrome DevTools Protocol after retrying for 50 seconds. This usually indicates there was a problem opening the Chrome browser. The CDP port...
Read more >
Cypress Failed to Connect to Chrome: 5 Ways to Easily Fix it
1. Update the Chrome browser. On your computer and launch Chrome. · 2. Use Chrome-flavored browsers · 3. Debug the Chrome browser ·...
Read more >
cypress failed to make a connection to the ... - Code Grepper
Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds. ; 1. try below code in Plugins/index.js...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found