playwright
playwright copied to clipboard
VS Code extension: "Please install Playwright" notification appears when Playwright is already installed
Version
1.43.1
Steps to reproduce
This issue occurs when using Nix together with direnv, however I've also shared a reduced test case that reproduces the issue without these tools.
Test case using Nix and direnv
- Clone https://github.com/OliverJAsh/playwright-vscode-install-notification
- Run
echo "use flake" > ./.envrc
- Run
direnv allow
- Run
npm install
- Open VS Code
Standalone test case (no Nix/direnv)
- Clone https://github.com/OliverJAsh/playwright-vscode-install-notification
- Run
git checkout no-nix
- Run
npm install
- Open VS Code
Expected behavior
- The tests appear in the sidebar.
- Playwright does not show a notification for "Please install Playwright".
Actual behavior
- The tests correctly appear in the sidebar.
- Playwright shows a notification for "Please install Playwright", even though the tests loaded and run just fine.
Additional context
This is similar to https://github.com/microsoft/playwright/issues/29358 however in this case we're not using Yarn PnP.
It seems that the extension first discovers /.foo/playwright.config.ts
and then fails when it attempts to resolve @playwright/test
. The extension then continues and finds /playwright.config.ts
in the root directory and this time succeeds, however the error message from the first attempt is still being raised and shown as a notification.
The extension should not show any error if the tests load successfully, even if it takes a couple of attempts.
Environment
System:
OS: macOS 14.4.1
CPU: (10) arm64 Apple M1 Pro
Memory: 507.78 MB / 16.00 GB
Binaries:
Node: 20.12.2 - /nix/store/9zli090ri6wlhjla6bb51dg326ann92x-nodejs-20.12.2/bin/node
npm: 10.5.0 - /nix/store/9zli090ri6wlhjla6bb51dg326ann92x-nodejs-20.12.2/bin/npm
IDEs:
VSCode: 1.88.1 - /etc/profiles/per-user/oliver/bin/code
Languages:
Bash: 5.2.26 - /nix/store/lp3ginchcanhcj4dgw6yzdgv8bgdkm1v-bash-5.2p26/bin/bash
npmPackages:
@playwright/test: ^1.43.1 => 1.43.1
I have a similar issue. I think it's related that it doesn't like playwright
configs being in a workspace instead of the root of the project/repository.
Appears to work fine when you install playwright
in the root package.json
instead of the workspace.