[Bug]: Cannot do 'yarn create playwright --ct' without error
Version playwright : 1.43.0
Steps to reproduce Clone repo at https://github.com/ErwanPiaut/playwright-project.git yarn install yarn create playwright --ct Choose Javascript Choose Web components Keep the other option as default You should see the error
Expected behavior I expect the installation to work
Actual behavior yarn add v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. success Saved 13 new dependencies. info Direct dependencies └─ @sand4rt/[email protected] info All dependencies ├─ @esbuild/[email protected] ├─ @playwright/[email protected] ├─ @rollup/[email protected] ├─ @rollup/[email protected] ├─ @sand4rt/[email protected] ├─ @types/[email protected] ├─ [email protected] ├─ [email protected] ├─ [email protected] ├─ [email protected] ├─ [email protected] ├─ [email protected] └─ [email protected] Done in 2.74s. Downloading browsers (yarn playwright install)… yarn run v1.22.19 $ /home/florence/Test_poc/temp/playwright-project/node_modules/.bin/playwright install node:internal/modules/cjs/loader:598 throw e; ^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './cli' is not defined by "exports" in /home/florence/Test_poc/temp/playwright-project/node_modules/@playwright/experimental-ct-core/package.json at exportsNotFound (node:internal/modules/esm/resolve:303:10) at packageExportsResolve (node:internal/modules/esm/resolve:650:9) at resolveExports (node:internal/modules/cjs/loader:591:36) at Module._findPath (node:internal/modules/cjs/loader:668:31) at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27) at Module._load (node:internal/modules/cjs/loader:985:27) at Module.require (node:internal/modules/cjs/loader:1235:19) at require (node:internal/modules/helpers:176:18) at Object. (/home/florence/Test_poc/temp/playwright-project/node_modules/@sand4rt/experimental-ct-web/cli.js:17:18) at Module._compile (node:internal/modules/cjs/loader:1376:14) { code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }
Node.js v20.11.1 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Error: Command failed: yarn playwright install at checkExecSyncError (node:child_process:890:11) at execSync (node:child_process:962:15) at executeCommands (/home/florence/.config/yarn/global/node_modules/create-playwright-sand4rt/lib/index.js:4519:39) at Generator.run (/home/florence/.config/yarn/global/node_modules/create-playwright-sand4rt/lib/index.js:4679:5) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /home/florence/.config/yarn/global/node_modules/create-playwright-sand4rt/lib/index.js:4977:3 { status: 1, signal: null, output: [ null, null, null ], pid: 29795, stdout: null, stderr: null } error Command failed. Exit code: 1 Command: /home/florence/.yarn/bin/create-playwright Arguments: --ct Directory: /home/florence/Test_poc/temp/playwright-project Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
Environment System: OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish) CPU: (4) x64 Intel(R) Core(TM) i5-6440HQ CPU @ 2.60GHz Memory: 10.85 GB / 15.29 GB Container: Yes Binaries: Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node Yarn: 1.22.19 - /usr/bin/yarn npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm IDEs: VSCode: 1.87.1 - /usr/bin/code Languages: Bash: 5.1.16 - /usr/bin/bash npmPackages: @playwright/test: ^1.43.0 => 1.43.0
Hi, https://github.com/microsoft/playwright/pull/30269 needs to be resolved first before I could update the lib to the latest version. related to: https://github.com/microsoft/playwright/issues/29544
The /playwright folder and playwright.config.ts file could be copied from this repo to in the meantime:
https://github.com/sand4rt/playwright-ct-web/tree/master/ct-web
I have tried to use @sand4rt/experimental-ct-web with playwright 1.41.0. But I keep having the same error. I have scearch and find something.
in the file './node_modules/@sand4rt/experimental-ct-web/package.json' their is a dependency : "@playwright/experimental-ct-core": "^1.41.0"
With the new playwright version (1.43.0), playwright/experimental-ct-core will be set at 1.43.0 in node_modules/@sand4rt/experimental-ct-web/node_modules/@playwright/experimental-ct-core/package.json
That's were I think the error come from.
I have found a solution using Selective dependency resolutions of yarn. It need to be set in the package.json of the project like this : "resolutions": { "@sand4rt/experimental-ct-web/**/@playwright/experimental-ct-core": "1.41.0" }