Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable --headless=new for Chrome - fails with Chrome 117 #5483

Closed
MikeMcC399 opened this issue Sep 15, 2023 · 4 comments
Closed

Disable --headless=new for Chrome - fails with Chrome 117 #5483

MikeMcC399 opened this issue Sep 15, 2023 · 4 comments
Assignees

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Sep 15, 2023

Subject

Plugins > Browser Launch API > Disable --headless=new for Chrome

Description

The documentation section Plugins > Browser Launch API > Disable --headless=new for Chrome says:

Starting in Chrome 112, you can change the value of the --headless flag to the old value before the --headless=new flag was introduced.

If the parameter --headless is passed to Chrome 117 then Cypress no longer runs, so the advice in the article does not work for this version of Chrome.

Using Cypress 13.2.0, Node.js 20.6.1

  • Ubuntu 22.04.3 LTS
    Chrome stable 117.0.5938.62

  • Windows 11 Pro
    Chrome stable 117.0.5938.63

For both operating systems the errors are the same. (The port number is random.)
It may also fail immediately with ECONNREFUSED or ECONNRESET error.

Still waiting to connect to Chrome, retrying in 1 second (attempt 18/62)
Still waiting to connect to Chrome, retrying in 1 second (attempt 19/62)
...
Still waiting to connect to Chrome, retrying in 1 second (attempt 61/62)
Still waiting to connect to Chrome, retrying in 1 second (attempt 62/62)
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 50676.

Error: connect ECONNREFUSED 127.0.0.1:50676
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)

OR

read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)

Repro steps

On a local system with Google Chrome 117 installed:

git clone --branch test/chrome-stable-headless-cypress-latest https://github.com/MikeMcC399/github-action
cd github-action/examples/browser
npm ci
npx cypress info
npm run cy:run:chrome

Suggestion

Review the article Plugins > Browser Launch API > Disable --headless=new for Chrome and consider if it needs to be adjusted due to the issues with Chrome 117.

The parameter --headless=old, which is not mentioned in the article, also fails in Chrome 117.

Note: Cypress 13.2.0 and Chrome 117 work fine together out-of-the-box if the headless parameter is not manipulated.

Related issues

References

Currently, passing the --headless command-line flag without an explicit value still activates the old Headless mode — but we plan to change this default to new Headless over time.

@MikeMcC399
Copy link
Contributor Author

MikeMcC399 commented Sep 19, 2023

Using Chrome Canary build on Windows win64 downloaded from
https://www.google.com/chrome/canary/?platform=win64
Version 119.0.6017.1 (Official Build) canary-dcheck (64-bit)

git clone --branch test/chrome-stable-headless-cypress-latest https://github.com/MikeMcC399/github-action
cd github-action/examples/browser
npm ci
npx cypress info
npx cypress run --browser chrome:canary

runs without error.

The documentation should not be changed due to the Chromium bug, which is fixed and expected to roll out to stable versions.

@MikeMcC399 MikeMcC399 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2023
@ZwitterKaneda
Copy link

Hello, I have the same problem, for the moment my quick solution was to migrate to another browser. Both Electron, Firefox and Edge work perfectly.

Cypress 12.17.0
node v18.18.0
Google Chrome 117.0.5938.88
Zorin OS 16.3

image

The ufw (Uncomplicated Firewall) check is to rule out that it is responsible for not connecting
I can't think of what else to advance with chrome.

greetings

@MikeMcC399
Copy link
Contributor Author

@ZwitterKaneda

We are not normally seeing this issue with Cypress 12.17.0, however if you have found a workaround, then you don't need to look further. I suggest that you track issue cypress-io/cypress#27804 to hear when there is a Chrome stable release which fixes the issue.

@ZwitterKaneda
Copy link

It was actually the chrome version that was bothering me.
I went back to 104.0.5112.101, now everything works correctly 🚀

Thanks, I was coming to comment on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants