[BUG] browserType.launch: Chromium distribution 'chrome' is not found (circleci)

See original GitHub issue

Context:

  • Playwright Version: 1.16.3
  • Operating System: Linux
  • Node.js version: v16.13.0
  • Browser: Chromium
  • Extra: @playwright/test, CircleCi - run playwright with docker-compose

Code Snippet

I’m using the following dockerfile for the playwright:

FROM mcr.microsoft.com/playwright:focal
WORKDIR /usr/e2e
COPY package.json yarn.lock ./
RUN yarn install
RUN apt-get update && apt-get install -y wget
RUN npx playwright install chrome // why this command doesn't help?
COPY . ./
RUN yarn build

Playwright config:

const config = {
  use: {
    baseURL: process.env.REACT_APP_URL || 'http://localhost:3000',
    viewport: viewport,
    ignoreHTTPSErrors: true,
  },
  globalSetup: require.resolve('./playwright/global.ts'),
  projects: [
    {
      name: 'Chrome Stable',
      use: {
        browserName: 'chromium',
        channel: 'chrome',
      },
    },
    {
      name: 'Desktop Safari',
      use: {
        browserName: 'webkit',
      },
    },
    {
      name: 'Desktop Firefox',
      use: {
        browserName: 'firefox',
      },
    },
  ],
  retries: 2,
}

Describe the bug

I’m not sure is it a playwright problem or circleci but anyway…

When i start playwright locally - everything is good, tests are completed successfully. When I run tests in the docker-compose in circleci with caching option docker_layer_caching: true - get the error (without this option tests finish successfully):

browserType.launch: Chromium distribution 'chrome' is not found at /opt/google/chrome/chrome
    Run "npx playwright install chrome"

Everything worked in the previous months, but this error began to appear a few weeks ago. Safari and firefox work well.

Tried suggestions from https://github.com/microsoft/playwright/issues/9858 - it didn’t help.

Any ideas? Maybe someone has faced such a problem?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mxschmittcommented, Aug 18, 2022

FYI Having this issue with mcr.microsoft.com/playwright:v1.21.0-focal

You are using channels. Channels need to be installed manually using npx playwright install chrome

1reaction
worphcommented, May 23, 2022

FYI Having this issue with mcr.microsoft.com/playwright:v1.21.0-focal

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with the browser circleci/browser-tools@1.1.3
Hey we seem to get an error when using the circleci/browser-tools@1.1.3 orb with our custom docker container, we get error code 127 so...
Read more >
Playwright: “Failed to launch Browsers” — how to solve?
“Error: Failed to launch chromium because executable doesn't exist”. This post explains how to solve the above issue in the CI.
Read more >
How to use installed version of chrome in Playwright?
I want to use chrome instead of chromium.
Read more >
Troubleshooting | Cypress Documentation
Cypress attempts to automatically find installed Chrome versions for you. However, probing for browsers across different environments can be error-prone.
Read more >
Failed to launch chromium because executable doesn't exist
Hi, I'm trying to use Playwright in a Netlify function but I get this error on deploy (works great locally with netlify dev): ......
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