Skip to content

Commit 040978c

Browse files
NERLOEclaude
andcommitted
fix(build): playwright extension parses the 1.58+ install --dry-run output
Playwright 1.58 changed the per-browser header printed by `playwright install --dry-run` from `browser: <name> version <v>` to `<Product> <v> (playwright <name> v<build>)`, so the extension's grep found nothing and the image build failed at that step. The header match now accepts both formats. The context window after the header is also narrowed to the two lines the extension reads (install location and download url): the new blocks are shorter than the old five-line ones, so the previous window ran into the next browser's install location and would have unpacked the archive into the wrong directory. Fixes #3089 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent e3db7a8 commit 040978c

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/build": patch
3+
---
4+
5+
Fix the `playwright` build extension for Playwright 1.58+. The extension reads `playwright install --dry-run` to find each browser's download URL, and 1.58 changed the per-browser header from `browser: chromium-headless-shell version …` to `Chrome Headless Shell … (playwright chromium-headless-shell v…)`, so the image build failed at the `grep` step with exit code 1. The header match now accepts both formats, and the context window after the header is narrowed to the two lines actually used (install location and download url): 1.58+ blocks are shorter than before, so the old window ran into the next browser's install location and would have extracted the archive into the wrong directory.

packages/build/src/extensions/playwright.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,13 @@ class PlaywrightExtension implements BuildExtension {
317317

318318
Array.from(browsersToInstall).forEach((browser) => {
319319
instructions.push(
320-
`RUN grep -A5 -m1 "browser: ${browser}" /tmp/browser-info.txt > /tmp/${browser}-info.txt`,
320+
// Playwright < 1.58 prints `browser: <name> version <v>`; 1.58+ prints
321+
// `<Product> <v> (playwright <name> v<build>)`. The trailing space / `v`
322+
// keep `chromium` from matching the `chromium-headless-shell` block.
323+
// Only the two lines after the header are needed (install location and
324+
// download url); 1.58+ blocks are that short, so a longer window would
325+
// bleed into the next browser's install location.
326+
`RUN grep -A2 -m1 -E "browser: ${browser} |\\(playwright ${browser} v" /tmp/browser-info.txt > /tmp/${browser}-info.txt`,
321327

322328
`RUN INSTALL_DIR=$(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs) && \
323329
DIR_NAME=$(basename "$INSTALL_DIR") && \

0 commit comments

Comments
 (0)