Chrome headless fails with "Error: could not find CRI target"
See original GitHub issueCurrent 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
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:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Duplicate of https://github.com/cypress-io/cypress/issues/6053