Skip to content

[Bug]: Not able to install Playwright in Docker on M1 with aarch64 architecture #796

@budsee

Description

@budsee

Playwright version

1.12.1

Operating system

MacOS

What browsers are you seeing the problem on?

Chromium

Other information

No response

What happened? / Describe the bug

Hi

I'm using playwright docker image here => https://hub.docker.com/_/microsoft-playwright

I encounter an issue where if I run playwright in the docker, I would have the below error

(node:97) UnhandledPromiseRejectionWarning: Error: Page closed
at CRSession. (/usr/local/lib/python3.8/dist-packages/playwright/driver/package/lib/server/chromium/crPage.js:341:60)
at Object.onceWrapper (events.js:420:28)
at CRSession.emit (events.js:326:22)
at /usr/local/lib/python3.8/dist-packages/playwright/driver/package/lib/server/chromium/crConnection.js:177:43
(node:97) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

It run fine in my own machine (macOS m1). I research and saw that it is related to browser.close too early. However, I'm using pytest and is using playwright as sync and not async function since pytest has fixture which can yield the page and then do a browser close later. E.g code below:

@pytest.fixture
def page():
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
yield page
browser.close()

Do we. know why the same code run fine in my local machine but not in playwright docker?

Code snippet to reproduce your bug

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    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