Skip to content
This repository was archived by the owner on Oct 17, 2024. It is now read-only.
This repository was archived by the owner on Oct 17, 2024. It is now read-only.

Error on Init : "error while loading shared libraries" #13

@CyberV

Description

@CyberV

Hi team,

First of all, THANK YOU SOOO MUCH for this wonderful library. Loving it!

I have been using the heroku playwright buildpack for the past 1 year and was running smoothly on the heroku app. A week back, I started running into the following issue on App Build.

Build Error on Server. Works flawlessly on local. (y)

Aug 30 23:26:53 autom8 app/web.1 == ERROR in Playwright Init == { Protocol error (Target.setAutoAttach): Target closed.
Aug 30 23:26:53 autom8 app/web.1 =================== chromium.launch logs ===================
Aug 30 23:26:53 autom8 app/web.1 /app/node_modules/playwright-chromium/.local-browsers/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-xFUfUO --remote-debugging-pipe --no-sandbox --no-startup-window
Aug 30 23:26:53 autom8 app/web.1 pid=35
Aug 30 23:26:53 autom8 app/web.1 /app/node_modules/playwright-chromium/.local-browsers/chromium-775089/chrome-linux/chrome: error while loading shared libraries: libxcb-dri3.so.0: cannot open shared object file: No such file or directory
Aug 30 23:26:53 autom8 app/web.1
Aug 30 23:26:53 autom8 app/web.1 ============================================================
Aug 30 23:26:53 autom8 app/web.1 Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.Error
Aug 30 23:26:53 autom8 app/web.1 at Promise (/app/node_modules/playwright-chromium/lib/chromium/crConnection.js:132:63)
Aug 30 23:26:53 autom8 app/web.1 at new Promise ()
Aug 30 23:26:53 autom8 app/web.1 at CRSession.send (/app/node_modules/playwright-chromium/lib/chromium/crConnection.js:131:16)
Aug 30 23:26:53 autom8 app/web.1 at CRSession.send (/app/node_modules/playwright-chromium/lib/helper.js:65:31)
Aug 30 23:26:53 autom8 app/web.1 at Function.connect (/app/node_modules/playwright-chromium/lib/chromium/crBrowser.js:57:27)
Aug 30 23:26:53 autom8 app/web.1 at Chromium._connectToTransport (/app/node_modules/playwright-chromium/lib/server/chromium.js:52:38)
Aug 30 23:26:53 autom8 app/web.1 at Chromium._innerLaunch (/app/node_modules/playwright-chromium/lib/server/browserType.js:86:36)
Aug 30 23:26:53 autom8 app/web.1 message:
Aug 30 23:26:53 autom8 app/web.1 'Protocol error (Target.setAutoAttach): Target closed.\n=================== chromium.launch logs ===================\n /app/node_modules/playwright-chromium/.local-browsers/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-xFUfUO --remote-debugging-pipe --no-sandbox --no-startup-window\n pid=35\n/app/node_modules/playwright-chromium/.local-browsers/chromium-775089/chrome-linux/chrome: error while loading shared libraries: libxcb-dri3.so.0: cannot open shared object file: No such file or directory\n\n============================================================\nNote: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.' }

image

Package.json:

{
"name": "heroku-playwright-example",
"version": "1.0.0",
"description": "Example how you can use Playwright on Heroku",
"scripts": {
"start": "node src/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mxschmitt/heroku-playwright-example.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/mxschmitt/heroku-playwright-example/issues"
},
"homepage": "https://github.com/mxschmitt/heroku-playwright-example#readme",
"dependencies": {
"cors": "^2.8.5",
"crypto-js": "^4.0.0",
"express": "^4.17.1",
"node-fetch": "^2.6.1",
"nodemon": "^2.0.3",
"playwright-chromium": "^1.1.1",
"playwright-firefox": "^1.1.1",
"request": "^2.88.2"
},
"engines": {
"node": "10.13"
}
}

Playwright Init Code:

browser = await { chromium, firefox }[browserName].launch(browserName === "chromium" ? {
args: ['--no-sandbox'],
chromiumSandbox: false,
headless: true
} : {});

  • I found some posts pointing to an issue with Nodev.14.0 and tried setting node version on heroku to mirror my local environment but same error.
  • I checked the demo app in repo and it seems to be working fine

Any idea what can be causing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions