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

Don't work with Playwright 1.38 #327

Open
aninde opened this issue Oct 23, 2023 · 14 comments · Fixed by #350
Open

Don't work with Playwright 1.38 #327

aninde opened this issue Oct 23, 2023 · 14 comments · Fixed by #350

Comments

@aninde
Copy link

aninde commented Oct 23, 2023

Bug description

In my project I'm using
"@playwright/browser-chromium": "^1.39.0",
"@playwright/browser-firefox": "^1.38.0",
"@playwright/browser-webkit": "^1.38.0",
"@playwright/test": "^1.38.0"

When I tried to run Lost Pixel I received
❌ browserType.launch: Executable doesn't exist at. ../ms-playwright/chromium-1076/chrome-mac/Chromium.app/Contents/MacOS/Chromium

Suggested npx playwright install didn't help, but I was able to fix it with workaround
in the folder /ms-playwright/ I copied existing /ms-playwright/chromium-1080/, paste it and rename it to chromium-1076

I bet upgrading Playwright to 1.38 on you package.json should solve this globally.

How to reproduce

  1. Use lost-pixel v3.8.0 with Playwright 1.38
  2. Build storybook
  3. Run Lost pixel
  4. See error in Terminal

Expected behavior

No response

Lost Pixel information

lost-pixel logs from CI

No response

@d-ivashchuk
Copy link
Collaborator

Thanks for reporting, we will take a look into this one! If you would have any other questions regarding lost pixel - feel free to ping me anytime 🙌🏼

@aninde
Copy link
Author

aninde commented Nov 6, 2023

Hi @d-ivashchuk! Any news here?

@Hai-San
Copy link

Hai-San commented Nov 23, 2023

Same problem here with playwright 1.40.0

In my case the folder name is chromium-1091 not chromium-1076

@greenskybluephish
Copy link

Seems like this is caused by listing playwright as a dev dependency, but the build is expecting the browsers that were used with the 1.37 version.

@d-ivashchuk
Copy link
Collaborator

I am sorry for not providing enough attention to this! will try to reproduce it once more. @greenskybluephish as you already got some notion on what's going on, do you want to give it a run as a PR fix?

@chbiel
Copy link

chbiel commented Dec 15, 2023

Experiencing the same, reproducable with:

mkdir lost-pixel-test
cd lost-pixel-text
npm init
npm i --save-dev lost-pixel @playwright/test
npx lost-pixel init-ts
npx lost-pixel

Results in error
browserType.launch: Executable doesn't exist at /home/dejhcb0c/.cache/ms-playwright/chromium-1076/chrome-linux/chrome

@d-ivashchuk
Copy link
Collaborator

@chbiel if you wanna give fix a go - very much welcome. Otherwise we will tackle it over the weekend!

@chbiel
Copy link

chbiel commented Dec 15, 2023

@d-ivashchuk I tried, but following the contribution guide does also not work right now :/

@d-ivashchuk
Copy link
Collaborator

would love to assist you with any troubles(and improve the docs for contribution guide at the same time :D) what challenges did you face?

@chriskalmar
Copy link
Collaborator

I'm very sorry for the late reply.
For the Lost Pixel Github Action to work correctly, we need to have a fixed version of Playwright.
Still, I believe, by going with a peerDependency we could solve that problem for local usages.

I've created a tiny beta npm version to test that theory.
If you (@aninde @Hai-San @chbiel) could give it a shot and report back 🙏 if it solves the issue it would be a great help and we could ship it as a regular version right away.

This is the version: 3.8.3-beta.1

npm i lost-pixel@3.8.3-beta.1

Of course, this requires you to also install your own playwright-core, but that's anyway what you wanted in the first place.
I hope it works 🤞

@Maxim-Mazurok
Copy link

Maxim-Mazurok commented Dec 26, 2023

Hey guys, had same issue, found a solution I think.

Basically when you run npx playwright - it will use latest version, not the one that is installed as lost-pixel's dependency.

And in the latest version it has different browsers.json file with default install version of chrome.

So the most sustainable solution is to run ./node_modules/lost-pixel/node_modules/.bin/playwright-core install --with-deps

Otherwise you can modify your command to use npx playwright@1.37.0 but you need to make sure version matches one from lost-pixel deps.

I guess alternatively you could configure your own browsers.json I'm not sure, first time using playwright node_modules/lost-pixel/node_modules/playwright-core/browsers.json
Hope this helps, cheers!

@chriskalmar
Copy link
Collaborator

Yes, @Maxim-Mazurok, this solution works too, but there's a drawback:
It binds your project to the Playwright version of the currently used Lost Pixel version.

Of course, some projects use Playwright just via Lost Pixel and that's fine, but if a project wants to run Playwright in a new version (to e.g. create integration tests) it would become a problem. That's why I moved playwright-core to peerDependencies to allow users to pick their own Playwright version.

Maybe you could give lost-pixel@3.8.3-beta.1 a shot and confirm that it works for you as well @Maxim-Mazurok ?

@Maxim-Mazurok
Copy link

Ah I see, makes sense, didn't read thread in detail. Sorry, don't have bandwidth for now, also not using playwright for anything other than lost-pixel for now, so happy with my setup, will be happy to try if anything changes and will report back, cheers!

@dmitrc
Copy link

dmitrc commented Mar 27, 2024

It seems like there is still an issue here, or am I doing something wrong?

In my package.json I have:

"@playwright/test": "^1.42.1",
"playwright-core": "^1.42.1", // just in case

When running lost-pixel, I get:

❌ browserType.launch: Executable doesn't exist at C:\Users\UserName\AppData\Local\ms-playwright\chromium-1091\chrome-win\chrome.exe
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝

When checking the browsers directory, I see a newer chromium-1097 instead.

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