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

[Bug]: Playwright error — Host system is missing dependencies to run browsers #1415

Open
dtinth opened this issue Aug 23, 2023 · 4 comments
Labels
aarch64 aarch64 (or arm64) systems bug Something isn't working javascript Pull requests that update Javascript code linker Related to linking (ld, ld.so or dyld) linux Linux systems

Comments

@dtinth
Copy link

dtinth commented Aug 23, 2023

Current Behavior (bug)
When running a Playwright test, browsers won’t run at all. Instead, tests immediately fail with this error message:

Running 2 tests using 1 worker
  1) [chromium] › example.spec.js:4:1 › has title ──────────────────────────────────────────────────

    Error: browserType.launch: 
    ╔══════════════════════════════════════════════════════╗
    ║ Host system is missing dependencies to run browsers. ║
    ║ Missing libraries:                                   ║
    ║     libgobject-2.0.so.0                              ║
    ║     libglib-2.0.so.0                                 ║
    ║     libnss3.so                                       ║
    ║     libnssutil3.so                                   ║
    ║     libsmime3.so                                     ║
    ║     libnspr4.so                                      ║
    ║     libatk-1.0.so.0                                  ║
    ║     libatk-bridge-2.0.so.0                           ║
    ║     libcups.so.2                                     ║
    ║     libgio-2.0.so.0                                  ║
    ║     libdbus-1.so.3                                   ║
    ║     libexpat.so.1                                    ║
    ║     libdrm.so.2                                      ║
    ║     libxcb.so.1                                      ║
    ║     libxkbcommon.so.0                                ║
    ║     libatspi.so.0                                    ║
    ║     libX11.so.6                                      ║
    ║     libXcomposite.so.1                               ║
    ║     libXdamage.so.1                                  ║
    ║     libXext.so.6                                     ║
    ║     libXfixes.so.3                                   ║
    ║     libXrandr.so.2                                   ║
    ║     libgbm.so.1                                      ║
    ║     libpango-1.0.so.0                                ║
    ║     libcairo.so.2                                    ║
    ║     libasound.so.2                                   ║
    ╚══════════════════════════════════════════════════════╝

Expected Behavior (fix)
Browsers should run just like in most environments.

Additional context
$ devbox version -v

Version:     0.5.11
Platform:    linux_arm64
Commit:      1052c4e37c16ce0df5d60afb8c82076cd290eee8
Commit Time: 2023-08-10T23:32:09Z
Go Version:  go1.20.7
Launcher:    0.2.0

devbox.json https://github.com/dtinth/devbox-playwright-issue/blob/main/devbox.json

To reproduce:

Use a Linux box.

  1. Clone this repo: https://github.com/dtinth/devbox-playwright-issue
  2. Enter a shell:
    devbox shell
    
  3. Install deps:
    pnpm install
    
  4. Install browsers:
    pnpm playwright install --with-deps
    
  5. Run test:
    pnpm playwright test
    
@dtinth dtinth added the bug Something isn't working label Aug 23, 2023
@gcurtis gcurtis added javascript Pull requests that update Javascript code linux Linux systems linker Related to linking (ld, ld.so or dyld) aarch64 aarch64 (or arm64) systems labels Jan 30, 2024
@apgrucza
Copy link
Contributor

I'm also trying to get Playwright to run in Devbox.

Relevant Nix packages seem to be playwright-test and playwright-driver. There are instructions here for getting Playwright to work in NixOS, but it's unclear how to translate that across to Devbox. Searching for playwright-driver.browsers gives no results at both https://www.nixhub.io/ and https://search.nixos.org/packages so I don't know how to install that package and obtain a value for PLAYWRIGHT_BROWSERS_PATH.

@jnnnnn
Copy link

jnnnnn commented May 8, 2024

The following devbox.json let me run playwright cr in a devbox shell and started up chromium:

{
  "packages": [
    "playwright@latest",
    "playwright-driver@latest"
  ],
  "shell": {
    "init_hook": "export PLAYWRIGHT_BROWSERS_PATH=$(nix build --print-out-paths nixpkgs#playwright-driver.browsers)"
  }
}

@jnnnnn
Copy link

jnnnnn commented May 8, 2024

Additionally, playwright-test just works, it does the above export for you

@Leksat
Copy link

Leksat commented Sep 9, 2024

I met the Missing libraries error in the Github CI. I was adding devbox to the existing setup. Playwright was installed via pnpm.

For me the solution was PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true. Playwright started to work again after adding this env var.

(Found it in microsoft/playwright#5806 referenced from microsoft/playwright#5501)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aarch64 aarch64 (or arm64) systems bug Something isn't working javascript Pull requests that update Javascript code linker Related to linking (ld, ld.so or dyld) linux Linux systems
Development

No branches or pull requests

5 participants