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: could not find CRI target (Cypress 4.6.0)

See original GitHub issue

Current behavior:

cypress run fails with the following error on Chrome:

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 26359.

Error details:

Error: could not find CRI target
    at lazyAssLogic (C:\Users\user\AppData\Local\Cypress\Cache\4.6.0\Cypress\resources\app\packages\server\node_modules\lazy-ass\index.js:110:14)
    at Object.lazyAss (C:\Users\user\AppData\Local\Cypress\Cache\4.6.0\Cypress\resources\app\packages\server\node_modules\lazy-ass\index.js:115:28)
    at findStartPage (C:\Users\user\AppData\Local\Cypress\Cache\4.6.0\Cypress\resources\app\packages\server\lib\browsers\protocol.js:56:23)

Full log is also attached.

Note that this doesn’t appear to be 100% consistent. With the below example I am seeing this maybe 25% of the time.

We had previously observed this before, and upgraded to both 3.8.3 as a result of: https://github.com/cypress-io/cypress/issues/6053

Then more recently, upgraded to 4.6.0 as a result of: https://github.com/cypress-io/cypress/issues/6518

Still observing on 4.6.0 as below though

Desired behavior:

Execution should not fail in this manner.

Test code to reproduce

  1. Clone https://github.com/stevejefferies/cypress-test-tiny
  2. Run cypress:run as defined in package.json e.g. npm run cypress:run

Versions

Cypress: 4.6.0 Browser: Chrome 83 OS: Windows 10

Debug Log

debug_log.txt

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:32 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
stevejefferiescommented, Jun 9, 2020

Should have added to my comment above, for those looking for a potential workaround adding the disable-gpu flag on browser launch (plugins/index.js) seems stable for me at least locally: Cypress 4+:

module.exports = (on, config) => {
  on('before:browser:launch', (browser, launchOptions) => {
    if (browser.name === 'chrome' && browser.isHeadless) {
      launchOptions.args.push('--disable-gpu');
      return launchOptions
    }
  });
}

Or before Cypress 4:

module.exports = (on, config) => {
  on('before:browser:launch', (browser, args) => {
    if (browser.name === 'chrome' && browser.isHeadless) {
      args.push(
        '--disable-gpu'
      );
      return args;
    }
  });
}
3reactions
wasiqkhan786commented, Aug 27, 2020

@nids2307 try below code in Plugins/index.js its working

 module.exports = (on, config) => {
  on('before:browser:launch', (browser, launchOptions) => {
    if (browser.name === 'chrome' && browser.isHeadless) {
      launchOptions.args.push('--disable-gpu');
      return launchOptions
    }
  });
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

cypress-io/cypress - Gitter
I can run the tests in Electron no error. The error is Can't start server could not find CRI target. This is happening...
Read more >
Changelog - Cypress Documentation
Fixed an 11.0.0 regression where using custom reporters would cause Cypress to throw a 'Cannot find module' error. Fixes #24607; Fixed testIsolation ...
Read more >
Change log for 4.7.60
Exists() to find a host in the unmanaged state #130 ... Bug 1894041: VM import wizard: The target storage class name is not...
Read more >
cypress: Versions - Openbase
We fixed a regression in 4.6.0 where errors thrown from the application under ... We fixed an error during cypress run indicating could...
Read more >
RHSA-2021:2438 - Security Advisory - Red Hat 客户门户网站
Red Hat OpenShift Container Platform is Red Hat's cloud computing Kubernetes ... BZ - 1879140 - console auth errors not understandable by ...
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