-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 Chromium based tools don't work in WSL #21813
Comments
There is a flag that you can add to your .wslconfig file which disables GPU support for all WSL applications:
This flag was found through a Google search and is not otherwise in .wslconfig documentation, which is here: https://learn.microsoft.com/en-us/windows/wsl/wsl-config While disabling the GPU use in WSL not entirely ideal, this at least made the Chromium based application work on my system. This includes Playwright tools and other well-known apps. Maybe then, just don't use a WSL Chrome-based browser as a daily driver. I think this deserve a mention in Playwright documentation. |
I don't have this config file and it works on my machine with WSL2 out of the box using Ubuntu 20. Maybe you have something else configured which is non-default? Happy to mention something about WSL, but only if it affects default setups. |
I'm make very extensive use of WSL so I have a few settings changed in .wslconfig. I was 99% sure that this was not working when I got that computer but I did clear the .wslconfig file anyway to test it and make sure. I got this result which I now remember to be familiar... With .wslconfig gone, all the defaults, all I get are transparent windows. With WSLg disabled, and using an X server, the windows become black instead. In both cases, disabling the use of the GPU, locally for Chromium instances, or globally, fixes the problem. |
I made the gpuSupport change, this is what my
And wouldn't you know it... I literally spent an hour and 45 minutes before I found this issue, combed through the documentation, and found nothing. As someone evaluating between Cypress & Playwright, this would've been a dealbreaker, as I have no trouble running Cypress. Since there was literally zero mention about GPUs not working in WSL, I thought that my issue was with this: My computer is managed by my employer, and the Now that I got it working, I have to say... |
I confirm having the same issue for Chromium. Fixed by disabling GPU through that config. |
Why was this issue closed?Thank you for your contribution to our project. This issue has been closed due to its limited upvotes and recent activity, and insufficient feedback for us to effectively act upon. Our priority is to focus on bugs that reflect higher user engagement and have actionable feedback, to ensure our bug database stays manageable. Should you feel this closure was in error, please create a new issue and reference this one. We're open to revisiting it given increased support or additional clarity. Your understanding and cooperation are greatly appreciated. |
I'd have more understanding if real issues weren't closed with a copypasta response, esp. when the issue could be mitigated by mentioning it in the documentation. https://learn.microsoft.com/en-us/windows/wsl/troubleshooting <-- Not one word about GPU problems. I guess it's not that important since this issue is literally the 3rd thing that comes up when I search for "playwright wsl". |
It's 2am, I'm 12h into trying to get Playwright (but not only Playwright - it's been the last one to surrender it's misgivings and start working) to behave on my brand new PC (Win11 + WSL2 + Ubuntu22 + intel CPU), right after setting it up and the
in the I'll try to sort out all of my actions here later on for any1 looking, but I had exactly the same symptoms (the border of the window displayed, but transparent and without any content) on any of the Ubuntu apps more complex than xapps, such as playwrightless google-chrome and all the other browsers I've tried - which'd suggest that Playwright invocation of those browsers in the WSL setup is a victim of a bug laying elsewhere. |
System info
Playwright generally works on WSL but, in some case, the Chromium-based GUI tools might end up like this:
If this is the case, it's likely all Chromium based applications are likely broken and will have the same goth appearance. This means that your GPU is not properly supported in WSL. You can solve this on a per-app basis by passing the --disable-gpu flag to Chrome applications but Playwright does not allow that.
The text was updated successfully, but these errors were encountered: