-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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]: @playwright/experimental-ct-react
does not export package.json
, which breaks VS Code extension
#31491
Comments
This was referenced Jul 23, 2024
This was referenced Jul 26, 2024
Open
Open
Open
This was referenced Jul 30, 2024
Open
Open
Open
Open
Open
Open
This was referenced Aug 6, 2024
This was referenced Sep 19, 2024
Open
Open
Open
This was referenced Sep 24, 2024
Open
Open
This was referenced Sep 26, 2024
This was referenced Sep 27, 2024
Open
Open
Open
Open
Open
Open
This was referenced Oct 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
1.45.0
Steps to reproduce
Start a fresh Debian dev container in VS Code.
Install Node.js via the instructions at https://github.com/nodesource/distributions?tab=readme-ov-file#installation-instructions-deb.
Enable Corepack via
sudo corepack enable
.Initialize a Playwright project via
pnpm create playwright
. Note that it uses@playwright/test
.Install the Playwright Test extension (https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright).
Go to the Testing tab and observe that
tests/example.spec.ts
is listed as expected.Run
pnpm remove @playwright/test && pnpm add --save-dev @playwright/experimental-ct-react
.Go to the Testing tab and observe that
tests/example.spec.ts
is no longer detected when using@playwright/experimental-ct-react
instead of@playwright/test
.Expected behavior
I expect the Playwright Test extension for VS Code to work the same whether I'm using
@playwright/test
or@playwright/experimental-ct-react
.Actual behavior
The Playwright Test extension for VS Code works with
@playwright/test
but not with@playwright/experimental-ct-react
.Additional context
If we take a look at https://github.com/microsoft/playwright-vscode/blob/v1.1.7/src/playwrightFinder.ts#L33, we see that the VS Code extension is trying to load
@playwright/experimental-ct-react
'spackage.json
file as follows:This is fine for
@playwright/test
since it exportspackage.json
:playwright/packages/playwright-test/package.json
Lines 17 to 27 in 4089f45
However, this doesn't work for
@playwright/experimental-ct-react
since it doesn't exportpackage.json
:playwright/packages/playwright-ct-react/package.json
Lines 17 to 30 in 4089f45
Indeed, if we run that line of code in a test script, we encounter the following error:
Suggested fix
The fix should be as simple as adding a
"./package.json": "./package.json"
entry to theexports
section of@playwright/experimental-ct-react
'spackage.json
file.Note that you'll probably want to do the same for the other
@playwright/experimental-ct-*
packages as well.Environment
System: OS: Linux 6.6 Debian GNU/Linux 11 (bullseye) 11 (bullseye) CPU: (12) arm64 unknown Memory: 19.30 GB / 23.44 GB Container: Yes Binaries: Node: 22.3.0 - /usr/bin/node npm: 10.8.1 - /usr/bin/npm pnpm: 9.4.0 - /usr/bin/pnpm IDEs: VSCode: 1.90.2 - /vscode/vscode-server/bin/linux-arm64/5437499feb04f7a586f677b155b039bc2b3669eb/bin/remote-cli/code Languages: Bash: 5.1.4 - /bin/bash npmPackages: @playwright/experimental-ct-react: ^1.45.0 => 1.45.0
The text was updated successfully, but these errors were encountered: