Skip to content

Commit 02f0f3d

Browse files
B4nanclaude
andauthored
ci: pin @puppeteer/browsers to v3 to fix Chrome install (#919)
## What Add a pnpm `overrides` entry to pin `@puppeteer/browsers` to v3 even though our direct `puppeteer` devDep stays on v24. Also reverts the misdiagnosed `PUPPETEER_SKIP_DOWNLOAD=1` workaround from #912. ## Why Reported Node-24-only test failures are caused by a known upstream bug: - `puppeteer@24` → `@puppeteer/browsers@2.x` → `extract-zip@2.0.1` (unmaintained since 2020). - On newer Node releases, `extract-zip` silently aborts mid-stream without rejecting, exits with code 0, and leaves the Chrome cache directory existing-but-empty (only the first archive entry, `ABOUT`, ends up on disk). Subsequent test runs fail with `Could not find Chrome (ver. 146.0.7680.153)`. Confirmed empirically — diagnostic instrumentation in [#916](#916) captured a clean repro: ``` puppeteer:browsers:install Downloading binary from https://storage.googleapis.com/... puppeteer:browsers:install Duration for download: 1321ms puppeteer:browsers:install Installing .../146.0.7680.153-chrome-linux64.zip to .../linux-146.0.7680.153 + find /home/runner/.cache/puppeteer -maxdepth 4 -type f /home/runner/.cache/puppeteer/chrome/linux-146.0.7680.153/chrome-linux64/ABOUT ← only ABOUT /home/runner/.cache/puppeteer/chrome/146.0.7680.153-chrome-linux64.zip ``` No `Duration for extract` debug line — `unpackArchive()` never resolved. ### Upstream - Tracking issue: [puppeteer/puppeteer#14957](puppeteer/puppeteer#14957) - Fix: [puppeteer/puppeteer#14960](puppeteer/puppeteer#14960) (merged 2026-05-11) — replaces `extract-zip` with native `unzip`/`tar.exe`. Released as `@puppeteer/browsers@3.0.0` (and bundled into `puppeteer@25.0.0`). ### Why override instead of bumping puppeteer to v25 `puppeteer@25` is ESM-only and requires Node ≥22.12. Both are surmountable for us, but pinning just the buggy transitive package is a smaller change with less risk surface: - This client only uses puppeteer as a Chrome installer for browser-bundle tests. `test/_helper.ts` calls into `@crawlee/puppeteer` (CJS, bundles its own `puppeteer-core`); the rest of the test code is type-only imports. No direct runtime use of puppeteer's main module. - puppeteer@24's CLI binary is CJS that does `require('@puppeteer/browsers')`. v3 is ESM-only, but `require()`-of-ESM is stable on Node ≥20.20 / ≥22.12 / ≥24 — empirically verified on all three locally with full extraction. - Lockfile diff: 270 insertions / 490 deletions vs. ~600 insertions / ~1100 deletions for the puppeteer v25 bump. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 49da2de commit 02f0f3d

3 files changed

Lines changed: 270 additions & 500 deletions

File tree

.github/workflows/check.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,6 @@ jobs:
4141

4242
- name: Install pnpm and dependencies
4343
uses: apify/actions/pnpm-install@v1.1.2
44-
env:
45-
# Puppeteer's postinstall kicks off the Chrome download in a
46-
# fire-and-forget Promise (downloadBrowsers() is not awaited
47-
# in puppeteer's install.mjs). When pnpm install returns
48-
# before the download finishes, ~/.cache/puppeteer is left
49-
# half-populated, and the subsequent `browsers install`
50-
# silently no-ops because the directory already exists.
51-
# Skip the postinstall download entirely and let the explicit
52-
# step below do it synchronously.
53-
PUPPETEER_SKIP_DOWNLOAD: 1
5444

5545
- name: Install Chrome for puppeteer
5646
run: pnpm exec puppeteer browsers install chrome

0 commit comments

Comments
 (0)