Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: npx playwright-chromium install --with-deps fails in v1.42.0 #29711

Closed
fjeldstad opened this issue Feb 28, 2024 · 2 comments · Fixed by #29715
Closed

[Bug]: npx playwright-chromium install --with-deps fails in v1.42.0 #29711

fjeldstad opened this issue Feb 28, 2024 · 2 comments · Fixed by #29715
Labels

Comments

@fjeldstad
Copy link

fjeldstad commented Feb 28, 2024

Version

1.42.0

Steps to reproduce

Run the following command:

npx playwright-chromium@1.42.0 install --with-deps

Expected behavior

Playwright installs successfully.

Actual behavior

An error is thrown:

node:internal/modules/cjs/loader:553
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/program' is not defined by "exports" in /[...]/node_modules/playwright-core/package.json
    at new NodeError (node:internal/errors:405:5)
    at exportsNotFound (node:internal/modules/esm/resolve:259:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:589:9)
    at resolveExports (node:internal/modules/cjs/loader:547:36)
    at Module._findPath (node:internal/modules/cjs/loader:621:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1034:27)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/[...]/node_modules/playwright-chromium/cli.js:18:21) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v20.6.1

Additional context

I have tested this both locally on macOS 14.3.1 and in CI (Ubuntu 20.04) - same result. If I run the same command using version 1.41.2 everything works.

Environment

System:
    OS: macOS 14.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 25.07 MB / 32.00 GB
  Binaries:
    Node: 20.6.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.8.1 - /usr/local/bin/npm
    pnpm: 8.6.3 - /usr/local/bin/pnpm
  IDEs:
    VSCode: 1.86.2 - /usr/local/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash
@DRichter-r
Copy link

It seems there is a missing export in the playwright-core/package.json

I think adding the export "./lib/program": "./lib/cli/program.js" might fix this problem.

@pavelfeldman
Copy link
Member

The fix will be a part of 1.42.1 patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants