ci: pin @puppeteer/browsers to v3 to fix Chrome install on newer Node#3679
Merged
Conversation
The transitive @puppeteer/browsers@2.x (pulled in by puppeteer@24) uses extract-zip@2.0.1 (unmaintained since 2020). On newer Node releases extract-zip silently aborts mid-stream without rejecting, leaving the Chrome cache directory existing-but-empty (only the first archive entry on disk) and the install command exiting 0. Test runs then fail with "Could not find Chrome (ver. X)". @puppeteer/browsers v3 replaces extract-zip with system unzip/tar.exe. Pinning it via yarn resolutions is sufficient — puppeteer@24's CLI only uses the stable surface area that v3 keeps, and require() of v3's ESM module works on all supported Node versions (>=20.20 / 22.12 / 24) thanks to stabilized require-of-ESM. Net dependency cleanup: removes extract-zip + 34 of its transitive deps in yarn.lock. Upstream: puppeteer/puppeteer#14957 Fix: puppeteer/puppeteer#14960 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@puppeteer/browsers to v3 to fix Chrome install on newer Node
Node 18 has been EOL since 2025-04-30. Dropping it also unblocks the @puppeteer/browsers v3 override in the previous commit, which is ESM-only and can't be required from puppeteer-core's CJS ChromeLauncher on Node 18 (require(esm) stabilized in 20.19 / 22.12).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add a yarn
resolutionsentry to pin@puppeteer/browsersto v3 even though our directpuppeteerdevDep stays on v24.Why
Recent CI failures with
Could not find Chrome (ver. X)on newer Node releases are caused by a known upstream bug:puppeteer@24→@puppeteer/browsers@2.x→extract-zip@2.0.1(unmaintained since 2020).extract-zipsilently 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).Confirmed empirically against the sister repo apify-client-js — diagnostic instrumentation captured a clean repro:
No
Duration for extractdebug line —unpackArchive()never resolved.Upstream
extract-zipwith nativeunzip/tar.exe. Released as@puppeteer/browsers@3.0.0(bundled intopuppeteer@25.0.0).Why override instead of bumping puppeteer to v25
puppeteer@25is ESM-only, requires Node ≥22.12, and is a much bigger change. Pinning just the buggy transitive package is a smaller change with less risk surface:require('@puppeteer/browsers'). v3 is ESM-only, butrequire()-of-ESM is stable on Node ≥20.20 / ≥22.12 / ≥24 (verified locally with end-to-end install on each).extract-zipplus 34 of its transitive deps fromyarn.lock(456-line reduction).Same fix is being applied in apify-client-js: apify/apify-client-js#919.
🤖 Generated with Claude Code