Skip to content

[BUG] Executable doesn't exist on remote build for Linux Azure Functions #24455

@falkon13

Description

@falkon13

Hi,
We have been having issues with using Playwright Test usings in TypeScript in our Azure Function App on a Linux Consumption Plan. The issue is that the browser cannot be found and we get the error

{"message":"Stage 'Stage 2 - Start Browser' failed: Error: browserType.launch: Executable doesn't exist at /home/site/wwwroot/node_modules/playwright-core/.local-browsers/chromium-1071/chrome-linux/chrome\n╔═════════════════════════════════════════════════════════════════════════╗\n║ Looks like Playwright Test or Playwright was just installed or updated. ║\n║ Please run the following command to download new browsers: ║\n║ ║\n║ npx playwright install ║\n║ ║\n║ <3 Playwright Team ║\n╚═════════════════════════════════════════════════════════════════════════╝","stack":"Error: Stage 'Stage 2 - Start Browser' failed: Error: browserType.launch: Executable doesn't exist at /home/site/wwwroot/node_modules/playwright-core/.local-browsers/chromium-1071/chrome-linux/chrome\n╔═════════════════════════════════════════════════════════════════════════╗\n║ Looks like Playwright Test or Playwright was just installed or updated. ║\n║ Please run the following command to download new browsers: ║\n║ ║\n║ npx playwright install ║\n║ ║\n║ <3 Playwright Team ║\n╚═════════════════════════════════════════════════════════════════════════╝\n at Stage2StartBrowser. (/home/site/wwwroot/src/Models/Stage.ts:36:13)\n at Generator.throw ()\n at rejected (/home/site/wwwroot/dist/src/Models/Stage.js:6:65)"}

It seems like the node modules folder doesn't seem to output the correct structure when performing a remote build hence why it can't find the browser.
In the past we have used the "playwright-chromium" package which builds a correct node_modules output and the Function App can find and run the browser and as such we can use the browser there, however the reduced selector support makes it unusable for our latest project so we are trying ti use Playwright Test

System info

  • Playwright Version: [v^1.36.2]
  • Operating System: [Windows 10]
  • Browser: [Chromium]
  • Other info: Works perfectly fine when our usings are from "playwright-chromium" 1.3.0

Steps

  1. In Azure created a Linux & Node.js Azure Function App on a Consumption Plan
  2. Create a function app in VS Code using a headless browser
  3. Build using func azure functionapp publish [FUNC_APP_NAME] --build remote --javascript
  4. Navigate to generate URL to run function app and get the error

Expected
This is the file structure that gets outputted to our Function App when use a remote build when using "playwright-chromium" usings in TypeScript
image

This structure has the .local-browsers folder which contains the executuable that my Function App can run.

Actual
This is the file structure that gets outputted to our Function App when use a remote build when using @playwright/test usings in TypeScript
image
This structure does not have the .local-browsers folder so the Funcion App fails as it can't find the browser

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions