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.

Chrome headless fails with "Error: could not find CRI target"

See original GitHub issue

Current behavior:

I’m running the command node_modules/.bin/cypress run -b chrome --headless -s './cypress/integration/003_website_settings/01_init.js' (the path to the test is not relevant)

I get the error Error: could not find CRI target

I have tried on my Macbook and also on our CI server (Ubuntu).

Running with debug env variable shows the following

image

I think the relevant part is:

  cypress:network:connect received error on connect, retrying { iteration: 0, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:56319     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 56319 } } +250ms
  cypress:network:connect successfully connected { opts: { getDelayMsForRetry: [Function: _getDelayMsForRetry], port: 56319 }, iteration: 1 } +104ms
  cypress:server:protocol CRI.List on port 56319 +106ms
  cypress:server:protocol CRI List { numTargets: 0, targets: [] } +37ms
  cypress:server:cypress exiting with err Error: could not find CRI target

Desired behavior:

I would like the test to run in a headless Chrome instance.

Steps to reproduce: (app code and test code)

Install and run cypress with a test (the contents of the test seem to be irrelevant as it fails before it starts running the test.

Versions

Chrome Version 79.0.3945.79 Cypress Version 3.8.0

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
marmite22commented, Dec 18, 2019

Thank you, removing my node modules folder and re-installing so that I got the up to date version of that dependency has fixed the issue.

0reactions
jennifer-shehanecommented, Jan 9, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

cypress-io/cypress - Gitter
Is anyone else hitting errors with Cypress and Chrome 79? Our tests have started failing after ... The error is Can't start server...
Read more >
Reactjs cypress on firefox: Error: Could not find url target in ...
Targets were [] at C:\Users\IVS\AppData\Local\Cypress\Cache\10.0. 2\Cypress\resources\app\packages\server\lib\browsers\browser-cri-client.
Read more >
993686 - Problem with Chrome headless from CLI: empty PDF ...
Issue 993686: Problem with Chrome headless from CLI: empty PDF and error “Failed to serialize document: Uncaught”.
Read more >
Getting Started with Headless Chrome - Chrome Developers
A headless browser is a great tool for automated testing and server environments where you don't need a visible UI shell.
Read more >
Target domain - Chrome DevTools Protocol - GitHub Pages
Whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default).
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