trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

Playwright extension breaks with Playwright 1.58+ (--dry-run output format change)

Open p3droml opened this issue 9 months ago • 2 comments

Problem

The Playwright build extension (@trigger.dev/[email protected]) fails during Docker image builds when using Playwright 1.58+.

The extension runs npx playwright install --dry-run and then greps for "browser: chromium" to parse browser download URLs. Playwright 1.58 changed the --dry-run output format:

Playwright 1.57 (works):

browser: chromium version 143.0.7499.4
  Install location: ...
  Download url: ...

Playwright 1.58 (breaks):

Chrome for Testing 145.0.7632.6 (playwright chromium v1208)
  Install location: ...
  Download url: ...

The grep -A5 -m1 "browser: chromium" on this line finds no match, causing the build to fail with exit code 1.

Reproduction

// trigger.config.ts
playwright({
  browsers: ["chromium"],
  headless: false,
  // No version pinned - auto-detects 1.58.2
})

Build error:

[base  7/18] RUN grep -A5 -m1 "browser: chromium" /tmp/browser-info.txt > /tmp/chromium-info.txt
ERROR: process did not complete successfully: exit code: 1

Workaround

Pin the version to 1.57.0 in the extension config:

playwright({
  browsers: ["chromium"],
  headless: false,
  version: "1.57.0",
})

Suggested Fix

Update the grep pattern in the Playwright extension to handle both output formats. The new format uses (playwright <browser> v<revision>) which could be matched with a pattern like "playwright chromium" or by parsing the structured output differently.

p3droml avatar Feb 19 '26 03:02 p3droml

Same here but also had to downgrade playwright in my package.json, setting version in trigger config wasn't enough.

benpixel avatar Mar 16 '26 21:03 benpixel

Ran into this during the ClickHouse and Trigger.dev hackathon this week, and I think there is a second bug hiding behind this one. Even with the grep fixed, the extension's URL rewrite (sed "s/mac-arm64/linux/g") produces dead download URLs on 1.58+, because the artifacts are linux64 now (for example chromium-headless-shell-linux64.zip). So a deploy from a Mac gets past the grep and then fails at the curl.

I am running both fixes in production via pnpm patch: grep for (playwright ${browser} v instead, and rewrite mac-arm64 to linux64. Verified the linux64 artifacts exist on the CDN and Chromium works in the deployed workers. The patch is here if useful: https://github.com/mcheemaa/rendi/blob/main/patches/%40trigger.dev__build.patch

Happy to open a PR with both fixes. I see #4300 covered the grep half but was closed.

mcheemaa avatar Jul 23 '26 13:07 mcheemaa