Skip to content

[Feature] Apple Silicon support in node executable #1198

@rkennedy-mode

Description

@rkennedy-mode

Attempting to run Playwright (1.29.0) using Java (Azul 17.0.2) on macOS (Monterey 12.5.1) fails with the following error:

/var/folders/_0/vt4nh35x6fl9ztp69p2ss5rm0000gq/T/playwright-java-4698062101453362777/playwright.sh: line 6: /private/var/folders/_0/vt4nh35x6fl9ztp69p2ss5rm0000gq/T/playwright-java-4698062101453362777/node: Bad CPU type in executable

Unpacking the driver-bundle JAR and examining the bundled version of node reveals:

➜  file driver/mac/node 
driver/mac/node: Mach-O 64-bit executable x86_64

This results in the program failing to execute because it can't install browsers:

Exception in thread "main" java.lang.RuntimeException: Failed to create driver
	at com.microsoft.playwright.impl.driver.Driver.createAndInstall(Driver.java:105)
	at com.microsoft.playwright.impl.driver.Driver.ensureDriverInstalled(Driver.java:57)
	at com.microsoft.playwright.impl.PlaywrightImpl.createImpl(PlaywrightImpl.java:45)
	at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:35)
	at com.microsoft.playwright.Playwright.create(Playwright.java:110)
	at com.microsoft.playwright.Playwright.create(Playwright.java:114)
	at Scratch.main(scratch_1.java:5)
Caused by: java.lang.RuntimeException: Failed to install browsers, exit code: 126
	at com.microsoft.playwright.impl.driver.jar.DriverJar.installBrowsers(DriverJar.java:100)
	at com.microsoft.playwright.impl.driver.jar.DriverJar.initialize(DriverJar.java:69)
	at com.microsoft.playwright.impl.driver.Driver.initialize(Driver.java:64)
	at com.microsoft.playwright.impl.driver.Driver.createAndInstall(Driver.java:101)
	... 6 more

Can we add proper Apple Silicon support (i.e. without needing to install Rosetta)?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions