Docker - Browser: 'chrome' was not found on your system or is not supported by Cypress
See original GitHub issuecypress version 4.11
Current behavior:
cypress run --browser chrome --headless --spec "**/pr/*.spec.ts"",
Tests intermittently fails with the following.
Browser: 'chrome' was not found on your system or is not supported by Cypress - on docker
This happens more frequently in azure CI services on using cypress/browsers:node12.16.2-chrome81-ff75.
Workaround is to re-try the job several times.
Desired behavior:
Tests should run on chrome.
Test code to reproduce
Not sure how to provide a test code. This problem is very common with the above docker image and in Azure CI. I can provide the link to the CI job if needed.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:32 (3 by maintainers)
Top Results From Across the Web
Cypress Docker: Chrome was not found on your sysyem
Browser : chrome was not found on your system or is not supported by Cypress. Cypress supports the following browsers:
Read more >3 Ways to Fix Browser: Chrome Was Not Found on Your System
Usually, the error, browser: 'Chrome' was not found on your system occurs because the chrome.exe file is not installed in the default folder....
Read more >Launching Browsers | Cypress Documentation
All Chrome* flavored browsers will be detected and are supported above Chrome 64. You can launch Chrome like this: cypress run --browser chrome....
Read more >cypress-io/cypress - Gitter
I'm trying to run Cypress within docker (interactive mode), as described here [1], but shortly into a ... Browser: 'chrome' was not found...
Read more >How to Run Cypress Tests in Chrome and Edge | BrowserStack
Cypress browser support includes giants such as Google Chrome, ... For example, by only running smoke tests against Chrome and not Firefox, ...
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
I believe this is an issue with the Cypress launcher and not Docker image related. The issue is caused by not fully reading the output of the browser’s version command. In the
cypress:launcherlogs you will seeCould not extract version from stdout using regex: { stdout: '', versionRegex: <varies depending on browser> }. Note thatstdoutis empty and this log message is different from what you see when the binary is not found (which results inENOENTfor example).The issue is in
getOutput()https://github.com/cypress-io/cypress/blob/60b217cccedf28c56b0573665f0b3ee81813a4cc/packages/launcher/lib/utils.ts#L8-L40When the
exitevent occurs it is not guaranteed that the stdio streams are closed.According to the PR that introduced
getOutput()(https://github.com/cypress-io/cypress/pull/7039)To resolve the issue, Cypress could revert to using the
execapackage (assuming no breakage as mentioned in the PR) or updategetOutput()to ensure it fully reads the output.As an example, for Chrome Cypress tries all of
google-chrome,chrome, andgoogle-chrome-stableby default.https://github.com/cypress-io/cypress/blob/60b217cccedf28c56b0573665f0b3ee81813a4cc/packages/launcher/lib/browsers.ts#L7-L14
In the Cypress Docker images, only
google-chromeandgoogle-chrome-stablecan be used to run Chrome;chromedoes not work. This gives Cypress two tries to detect the browser. If running one binary fails to detect the browser because Cypress did not fully read the output, the opposite binary could still work. If the output is not read completely for both binaries then Cypress will conclude that Chrome is not installed. The issue is intermittent due to the timing related nature of the issue (sometimes stdout will have been fully read when theexitevent occurs but sometimes it hasn’t) and that Cypress may have to encounter the issue multiple times before detection of a single browser fails.I have observed one of the two Chrome detections fail in the Docker container by running
cypress infoin an infinite loop.I have observed the general issue when running Cypress intermittently with Cypress 6.x and Cypress 7.1.0.
You can see the issue with empty stdout in the provided logs
The earliest Cypress version I found this issue reported with is
4.12.0(https://github.com/cypress-io/cypress/issues/9044).getOutput()was released in Cypress4.4.1(https://github.com/cypress-io/cypress/issues/7020#issuecomment-616743402)Potential duplicate issues
Potential obsolete issues
Could a more up-to-date image containing the most up to date version of chrome-stable be released so that the workaround can be utilized? The application that I have automation built requires t the most recent version of chrome be used or else there is an error (This is for an internal application). I am getting the " Browser: ‘chrome’ was not found on your system or is not supported by Cypress." error using cypress/base:16.5.0 docker image. My Dockerfile handles retrieving the latest version of chrome-stable.
The most recent chrome/ff image is for chrome version 94 (chrome94-ff93). I require chrome-stable 96…