playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
2.25k stars 163 forks source link

[Bug]: Host system is missing dependencies to run browsers - on Ubuntu 24.04 #455

Closed naimsulejmani closed 4 months ago

naimsulejmani commented 6 months ago

2024/05/09 23:57:14 Downloading browsers...
Playwright Host validation warning: 
╔══════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers. ║
║ Missing libraries:                                   ║
║     libicudata.so.70                                 ║
║     libicui18n.so.70                                 ║
║     libicuuc.so.70                                   ║
║     libvpx.so.7                                      ║
╚══════════════════════════════════════════════════════╝
    at validateDependenciesLinux (/home/naimsulejmani/.cache/ms-playwright-go/1.42.1/package/lib/server/registry/dependencies.js:216:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Registry._validateHostRequirements (/home/naimsulejmani/.cache/ms-playwright-go/1.42.1/package/lib/server/registry/index.js:627:43)
    at async Registry._validateHostRequirementsForExecutableIfNeeded (/home/naimsulejmani/.cache/ms-playwright-go/1.42.1/package/lib/server/registry/index.js:725:7)
    at async Registry.validateHostRequirementsForExecutablesIfNeeded (/home/naimsulejmani/.cache/ms-playwright-go/1.42.1/package/lib/server/registry/index.js:714:43)
    at async t.<anonymous> (/home/naimsulejmani/.cache/ms-playwright-go/1.42.1/package/lib/cli/program.js:119:7)
2024/05/09 23:57:15 Downloaded browsers successfully

Recently, I upgraded my Ubuntu to the latest version, 24.04, and now my Go project is failing due to missing libraries as mention above. Are there any plans for a quick fix to address this issue?

canstand commented 6 months ago

Depend on upstream: https://github.com/microsoft/playwright/issues/30368

canstand commented 4 months ago

Solved in #472 (v0.4501.0)

yqchilde commented 1 month ago

in ubuntu:22.04 ╔══════════════════════════════════════════════════════╗ ║ Host system is missing dependencies to run browsers. ║ ║ Missing libraries: ║ ║ libglib-2.0.so.0 ║ ║ libgobject-2.0.so.0 ║ ║ libnss3.so ║ ║ libnssutil3.so ║ ║ libsmime3.so ║ ║ libnspr4.so ║ ║ libdbus-1.so.3 ║ ║ libatk-1.0.so.0 ║ ║ libatk-bridge-2.0.so.0 ║ ║ libcups.so.2 ║ ║ libgio-2.0.so.0 ║ ║ libdrm.so.2 ║ ║ libexpat.so.1 ║ ║ 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 ║ ╚══════════════════════════════════════════════════════╝

yqchilde commented 1 month ago

I found that this issue only exists with playwright install chromium, and everything is normal when I switch to chrome

canstand commented 1 month ago

Try run go run github.com/playwright-community/playwright-go/cmd/playwright@latest install --with-deps

yqchilde commented 1 month ago

Try run go run github.com/playwright-community/playwright-go/cmd/playwright@latest install --with-deps

Yes, that's correct, but it will cause the volume to increase in the container, and only chromium is the smallest, so I want to use chromium 🤣

However, I can currently use Chrome. Thank you for your contribution

canstand commented 1 month ago

Maybe you can use go run github.com/playwright-community/playwright-go/cmd/playwright@latest install chromium --with-deps. I'm pretty sure it ignores Firefox and Webkit and their dependencies.

yqchilde commented 1 month ago

也许你可以使用go run github.com/playwright-community/playwright-go/cmd/playwright@latest install chromium --with-deps。我很确定它会忽略 Firefox 和 Webkit 及其依赖项。

👍 good