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

[Question] Any ideas on how to get this to work on Raspbian? #2834

Closed
jimkang opened this issue Jul 4, 2020 · 4 comments
Closed

[Question] Any ideas on how to get this to work on Raspbian? #2834

jimkang opened this issue Jul 4, 2020 · 4 comments

Comments

@jimkang
Copy link

jimkang commented Jul 4, 2020

I really like how well Playwright works on most environments, but I'm having trouble getting it to run on Raspbian. All three browserTypes seem to have problems at launch.

The launch log for Chromium looks like this:

/tmp/webimage/node_modules/playwright/lib/chromium/crConnection.js:131
        return new Promise((resolve, reject) => {
               ^
Protocol error (Target.setAutoAttach): Target closed.
=================== chromium.launch logs ===================
<launching> /home/pi/.cache/ms-playwright/chromium-775089/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --user-data-dir=/tmp/playwright_chromiumdev_profile-eVSX1x --remote-debugging-pipe --headless --hide-scrollbars --mute-audio --no-startup-window
<launched> pid=24049
/home/pi/.cache/ms-playwright/chromium-775089/chrome-linux/chrome: 1: /home/pi/.cache/ms-playwright/chromium-775089/chrome-linux/chrome: cannot open 0�: No such file
/home/pi/.cache/ms-playwright/chromium-775089/chrome-linux/chrome: 1: /home/pi/.cache/ms-playwright/chromium-775089/chrome-linux/chrome: ELF����: not found
/home/pi/.cache/ms-playwright/chromium-775089/chrome-linux/chrome: 2: /home/pi/.cache/ms-playwright/chromium-775089/chrome-linux/chrome: 
      : not found

And then there are whole bunch of other "not found errors". Chromium is actually installed at the cited location (/home/pi/.cache/ms-playwright/chromium-775089/chrome-linux/chrome) with executable permission set for all.

Any ideas?

@mxschmitt
Copy link
Member

The issue has to do with the architecture of your system. Playwright's attached browsers are compiled for amd64, which most servers and computers are using. But the raspberry has armv7. If they don't match, binaries don't run and in our case browsers don't run.
So probably it would be more like a feature request 👍🏽.

As a workaround if Chromium is enough for you, you could install Chromium manually on it and set the executable path. This should also work, but be sure to use an canary / unstable build, so that all Playwright APIs are available.

@jimkang
Copy link
Author

jimkang commented Jul 4, 2020

Ah, I imagined arm would be a problem but was kind of hoping it was somehow handled. Thank you! I'll try your workaround.

@vipulgupta2048
Copy link
Contributor

As a workaround if Chromium is enough for you, you could install Chromium manually on it and set the executable path. This should also work, but be sure to use an canary / unstable build, so that all Playwright APIs are available.

Hey @mxschmitt I have been looking around the link you provided for setting the executable path of the chromium browser (Ours is /usr/bin/chromium). Can you provide us with an example of that would like in Playwright. Thanks

@burkeholland
Copy link

burkeholland commented Aug 21, 2023

@mxschmitt suggestion works - can confirm. The way I did it was to first determine your chromium install path...

which chromium-browser

Then pass that path as an option to the launch command...

playwright.chromium.launch({ executablePath: '/usr/bin/chromium-browser' })

Note: I did it headless. I don't think that matters but adding that info since it is a variable.

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

No branches or pull requests

4 participants