fix(deps): declare playwright-core as direct dependency#397
Merged
pavelfeldman merged 1 commit intomicrosoft:mainfrom May 4, 2026
Merged
fix(deps): declare playwright-core as direct dependency#397pavelfeldman merged 1 commit intomicrosoft:mainfrom
pavelfeldman merged 1 commit intomicrosoft:mainfrom
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree |
playwright-cli.js requires `playwright-core/lib/tools/cli-client/program` but only `playwright` is declared as a dependency. Under package managers that isolate transitives (pnpm with the default `isolated` linker), the require fails immediately on every install. Pinning `playwright-core` to the same version as `playwright` removes the dependency on hoisting and matches the existing transitive resolution. Fixes microsoft#396
c54b1b4 to
385dbfb
Compare
pavelfeldman
approved these changes
May 4, 2026
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.
Summary
playwright-cli.jsdoesrequire('playwright-core/lib/tools/cli-client/program')butpackage.jsononly declaresplaywright. Under pnpm's defaultisolatednode-linker, the require walk fails on every fresh install (Cannot find module 'playwright-core/lib/tools/cli-client/program').playwright-coretodependencies, pinned to the same1.60.0-alpha-1777669338000asplaywright. The existing transitive resolution stays the same, npm-hoisted layouts are unaffected, and isolated-layout installs (pnpm, pnp) now resolve correctly.@playwright/test'scli.js, which declaresplaywrightas a direct dep because it doesrequire('playwright/lib/program').playwright-corealready lists./lib/tools/cli-client/programin itsexportsfield; declaringplaywright-coredirectly here keepspackage.jsonin sync with the require.Test plan
nodeLinker: hoistedfrom the global pnpm config so the defaultisolatedlayout was active for the comparison.pnpm install -g @playwright/cli@latest(current npmlatest) crashes as above.npm packof this branch thenpnpm install -g ./playwright-cli-0.1.11.tgzproduces a working install:playwright-cli --versionreturns0.1.11,playwright-cli open https://example.comloads the page and captures a snapshot.npm installresolves cleanly (no change to hoisted-layout behavior).npm testpasses (tests/integration.spec.ts: open data URL, 1 passed).Fixes #396