playwright-dotnet: Azure Function .Net Core 3.1 - Failed to launch chromium because executable doesn't exist
I published a simple example to Azure Function (Windows) and I got the error:
Failed to launch chromium because executable doesn’t exist at C:\local\LocalAppData\ms-playwright\chromium-833159\chrome-win\chrome.exe Try re-installing the browsers running
playwright-cli.exe installin windows orplaywright-cli installin MacOS or Linux. Note: passdebug: "pw:api"to LaunchAsync to capture Playwright logs.
Any idea how to fix this? Thank you!
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (4 by maintainers)
While we’re working on getting the scenario documented and working, you can use a docker container: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-function-linux-custom-image?tabs=bash%2Cportal&pivots=programming-language-csharp
as long as you have ran
playwright installit should work.But this is something we’re working on.
I’d second this. I keep getting a message complaining that it can’t find the playwright driver in the bin folder, despite it being there. I use Linux on deployed and WSL/Windows locally and get the same message everywhere, but my unit test project doesn’t seem to have a problem finding and using playwright
copying the .playwright folder in the \bin\Debug\net6.0\bin folder did the trick for me. The output folder structure of an azure function is different. Currently Microsoft.PlayWright.targets indicates it will only copy to the standard build output folder, which is understandable. I have added the following to my .csproj: