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]: Cannot do 'yarn create playwright --ct' without error #40

Closed
ErwanPiaut opened this issue Apr 12, 2024 · 2 comments · Fixed by #41
Closed

[Bug]: Cannot do 'yarn create playwright --ct' without error #40

ErwanPiaut opened this issue Apr 12, 2024 · 2 comments · Fixed by #41
Labels
bug Something isn't working

Comments

@ErwanPiaut
Copy link

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/experimental-ct-web@1.41.0
info All dependencies
├─ @esbuild/linux-x64@0.18.20
├─ @playwright/experimental-ct-core@1.43.0
├─ @rollup/rollup-linux-x64-gnu@4.14.2
├─ @rollup/rollup-linux-x64-musl@4.14.2
├─ @sand4rt/experimental-ct-web@1.41.0
├─ @types/estree@1.0.5
├─ esbuild@0.18.20
├─ nanoid@3.3.7
├─ picocolors@1.0.0
├─ postcss@8.4.38
├─ rollup@3.29.4
├─ source-map-js@1.2.0
└─ vite@4.5.3
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

@ErwanPiaut ErwanPiaut added the bug Something isn't working label Apr 12, 2024
@sand4rt
Copy link
Owner

sand4rt commented Apr 12, 2024

Hi, microsoft/playwright#30269 needs to be resolved first before I could update the lib to the latest version. related to: microsoft/playwright#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

@ErwanPiaut
Copy link
Author

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"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants