I’m looking for help, I’m installed playwright locally in a React + TypeScript project and it works fine locally but in my Jenkins build I get an error
Error: browserType.launch: Failed to launch: Error spawn /home/Jenkins/.cache/yarn/ms-playwright/ms-playwright/chromium-1076/chrome-Linux/chrome ENOENT
basically to my understanding the browser is trying to launch but it doesn’t find a browser to launch, I tried a few ways but I haven’t get any success.
Is there anybody familiar with this issue? What can I do to fix this issue?
I’m attaching a picture of the Jenkins log for better understanding.
I will appreciate any help, thanks.
This thread is trying to answer question "What can I do to fix the issue of 'browserType.launch: Failed to launch' error in a Jenkins build of a React + TypeScript project using playwright?"
@mxschmitt I ran npx playwright install locally and it didn’t do anything. I ran yarn add firstname.lastname@example.org and did the same for the others browser and now I got a different error that say: Please install @playwright/test package before running “yarn playwright test”
I already have install @playwright/test, I’m not sure why this is an error:
I follow what I get in the Jenkins log but I go back to the browser.type.launch failed.
@mxschmitt I mention I follow what the error said. I removed the playwright-chromium, playwright-Firefox and playwright-WebKit. I don’t have playwright and I already have installed @playwrigh/test
When I removed the browser I get the error again about Error: browserType.launch: Failed.
Hi @jhul_11 I haven’t get anywhere. I still have the same issue, and I have t find any person here that is helpful yet. One thing I discovered is that npx playwright install, install the browser to a specific location, I create environment variable for workspace and made the installation to go to that path and also to look for the browser in that same path, but now what I get is that the browser is not able to launch.
I've just sussed mine out after reading a few posts on here & one reply from @mxschmitt .. I hope it's the same fix for you but all it needed was the latest playwright version. Perhaps the error could be enhanced slightly to suggest the latest version may not be installed? Otherwise you're just left scratching your head - I will now see about a way of always keeping on top of new pw releases to prevent it from happening again!
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email email@example.com.