-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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]: Can't launch Playwright VSCode extension due to "spawn node ENOENT" #33996
Comments
It seems that something messed up the path to node under vscode. One thing might be causing it is https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/nvm plugin that you use with "Oh My Zsh", can you try to disable it and run again? The code that searches for Node to run in the VSCode extension is here: https://github.com/microsoft/playwright-vscode/blob/6c301656dab9f7b4a167a29056a91f4a7279855c/src/utils.ts#L95 and our hunch is that it fails at some step. If you are comfortable with VSCode extension framework, you can try debugging that function: git clone https://github.com/microsoft/playwright-vscode/
cd playwright-vscode
npm i && npm run watch
# open VSCode and run launch there |
@yury-s Thanks for the quick response and the insights, disable the In the meantime, the problematic code comes from the lazy startup in the
|
Thanks for sharing, this is very helpful. I'm not sure if we are going to address it in the node search logic, given that it is specific to a particular mode of a peculiar shell setup, but having it documented here may help others. |
Okay here is a more in depth analysis:
In summary, the extension works fine if
At this point, I agree with @yury-s that the lazy loading case ( |
Very nice write-up, thank you! I think we can modify the logic of finding the node to handle the case of lazy loading. As an optimization we could run |
Version
1.49.1
Steps to reproduce
This is a bug report for the Playwright VSCode extension, I am not sure about how to reproduce as it is more like an environment related issue rather than code related, will just try to summarize the current findings and investigations.
The whole story begins after I installed the plugin, and I don't see anything listed under projects as shown in the Playwright doc, and I only see tests from the Vitest VSCode extension. Then I clicked
Refresh Tests
, and got an error message "Please install Playwright Test via runningnpm i --save-dev @playwright/test
", which leads me to #28703 and feels like my issue might be related to Node path.I toggle the Developer Tool and got the following error message, which says nothing about Node path but looks like it is trying to load the Node path
Error
It is similar to another issue I ran into on Vitest extension recently, which I resolved by setting its
shellType
to terminal. And this makes me feel that:I also tried to launch the VSCode from the terminal
code .
to see if it sets path properly and fixed the issue, but unfortunately it doesn't help.Basically I am running out of idea on debugging this, so any help would be appreciated.
Expected behavior
Playwright extension launch successfully
Actual behavior
Getting message "Please install Playwright Test via running
npm i --save-dev @playwright/test
" after clickingRefresh Tests
in the Testing tab.Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: