問題
最近同事使用 Playwright for .NET 將程式部署到 Azure 後,會發生以下的錯誤,
Driver not found: c:\home\site\wwwroot\.playwright\node\win32_x64\node.exe
解法
這個錯應該是因為在 Publish 後,部署的程式的包含 .playwright 的目錄,在部署到 Azure 時,沒有一併將 .playwright 的目錄部署上去。
所以將 .playwright 的目錄一併部署上去就可以了哦!
參考資源
Playwright driver not found error in Azure Function (Azure Portal - Flex consumption plan)
Using Playwright in a Windows-hosted Azure Function