Uh oh!
There was an error while loading. Please reload this page.
chore: test on Node 20-26, use a recent yarn berry, bump typescript - #178
Merged
Merged
Conversation
Dmitry Gozman (dgozman)force-pushed
the
ci-node-versions
branch
3 times, most recently
from
August 25, 2026 11:20
4a6cfd8 to
2e8f632Compare- Replace the Node 18 bots with Node 26. Playwright requires Node >=20, so every 18.x job was failing while installing `@playwright/test`. `engines.node` is bumped to >=20 accordingly. - Install yarn berry from npm instead of corepack. `yarn init`, which the generator runs, is a corepack "transparent command": in a project without a `packageManager` field corepack runs its own hardcoded default (4.14.1 today) and pins that into the generated project, no matter what `corepack prepare yarn@4 --activate` selected. Installing @yarnpkg/cli-dist directly makes the generated projects use the yarn we actually installed. - Skip the yarn-berry step on the Node 22 bots. On Node versions with a broken fstat for zip fds, the yarn PnP loader passes the CommonJS source to Node, which then loads Playwright through the ESM loader's CommonJS translator, where `require.cache` is undefined and loading test files fails with "TypeError: Cannot read properties of undefined". Node 22 is in that window for the current yarn. To be removed once the fix ships in @playwright/test. - Take a named lock in the tests that run `playwright install-deps`. Two of them running at the same time in different projects fight over the apt-get lock and fail with "Could not get lock /var/lib/apt/lists/lock". Requires a newer @playwright/test, and `fullyParallel` so that the lock is taken per test rather than per file. - Limit the yarn-classic project to a single worker. Yarn classic does not support concurrent access to its global cache and fails with EPERM/ENOENT on the `.yarn-tarball.tgz` files on Windows, now that `fullyParallel` lets two installs of the same project run at the same time. - Bump typescript to 6.0.3 and @types/node to 20.19.43. TypeScript 6 does not include @types/* automatically anymore, hence `types: ["node"]`. Dropping `include` puts the root playwright.config.ts into the project as well, so it is type checked instead of falling back to an inferred config in the editor. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019K5oVK8bNuHCvNVRauYieU
Dmitry Gozman (dgozman)force-pushed
the
ci-node-versions
branch
from
August 25, 2026 11:47
2e8f632 to
0dd2bf1CompareYury Semikhatsky (yury-s)
approved these changes
Aug 25, 2026
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Node matrix: drop 18, add 26
Playwright now requires Node
>=20, so all18.xjobs were failing while the generated projects installed@playwright/test:engines.nodeis bumped to>=20to match.Install yarn berry from npm instead of corepack
yarn init, which the generator runs, is a corepack transparent command: in a project without apackageManagerfield, corepack runs its own hardcoded default (4.14.1 with corepack 0.35.0) and pins that version into the generated project — regardless of whatcorepack prepare yarn@4 --activateselected. Installing@yarnpkg/cli-distdirectly means the generated projects run the yarn we actually installed (verified: the generatedpackage.jsonnow saysyarn@4.18.0).--forceis needed becauseyarn@1, installed earlier for the yarn-classic tests, already owns the globalyarnbin.Skip the yarn-berry step on the Node 22 bots
On Node versions with a broken fstat for zip fds, the yarn PnP loader hands the CommonJS source to Node instead of letting the CJS loader read the file out of the zip. Node then loads Playwright through the ESM loader's CommonJS translator, where the injected
requirehas nocacheproperty, and loading a test file fails:Which Node versions are affected moves with each yarn release (
HAS_BROKEN_FSTAT_FOR_ZIP_FDSin.pnp.loader.mjs); Node 22 is in the window for the current yarn, which is why the bug shows up here now and on Node 24 with the older pinned yarn. A fix forrequireOrImportis on the way in@playwright/test— theif:condition on the two yarn-berry steps should go away with it.Serialize the tests that share a resource
Three tests shell out to
playwright install-deps, which runsapt-get. When two of them run concurrently in different projects, one loses:This is an old flake — the same failure is on
mainfrom June. Those tests now declare{ lock: 'apt-get' }, so they never run at the same time while everything else stays parallel. Locks are held per job, and a job is a whole file unless tests run in parallel mode, sofullyParallelis turned on to make the lock per test.@playwright/testis bumped to1.63.0-alpha-2026-08-17for the lock support.fullyParallelin turn lets two installs of the same project run at once, which yarn classic does not survive — its global cache tears withEPERM/ENOENTon the.yarn-tarball.tgzfiles on Windows. The yarn-classic project is therefore limited toworkers: 1.Verified with the JSON reporter on the non-berry suite: zero overlapping runs among the locked tests, zero among yarn-classic tests, 142 overlapping pairs elsewhere, 49.7s wall time (51s before).
Bump typescript to 6.0.3 and @types/node to 20.19.43
TypeScript 6 no longer includes
@types/*automatically, sotypes: ["node"]is now explicit — without itnpx tsc --noEmitreports 143 errors (Cannot find name 'process',Cannot find namespace 'NodeJS', …). Droppingincludeputs the rootplaywright.config.tsinto the project too, so it is type checked rather than falling back to an inferred config in the editor.node_modulesandlibnow have to be listed inexclude, since specifyingexcludereplaces TypeScript's defaults.Verification
Ran locally on macOS with the same setup as the bots (yarn 4.18 as the global
yarn):--grep yarn-berry--grep-invert yarn-berrynpx tsc --noEmitandnpm run buildare clean.🤖 Generated with Claude Code
https://claude.ai/code/session_019K5oVK8bNuHCvNVRauYieU