azure: problem with puppeteer-cluster in function app that runs on a windows operating system

רן מנצור 1 Reputation point
2022-12-10T15:16:44.093+00:00

hello,

I am running a function  that uses a package  called "node-html-to-image" which uses puppeteer-cluster to generate images by html.
I am currently running it on windows function app and it gives me this error:

Error: Unable to launch browser, error message: spawn UNKNOWNat Cluster.<anonymous> (C:\home\site\wwwroot\node_modules\puppeteer-cluster\dist\Cluster.js:119:23)at Generator.throw (<anonymous>)at rejected (C:\home\site\wwwroot\node_modules\puppeteer-cluster\dist\Cluster.js:6:65)

my question is, can I run this function successfully on windows and if yes how?

thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-12-28T12:19:32.977+00:00

    Puppeteer is node.js library to control chromium and it would work with Linux platforms. For Function app on windows, it might be hitting the sandbox limitation. We have seen similar issues with puppeteer not working with Function Windows platform. Please refer to the below article written by one of our Team members.

    https://anthonychu.ca/post/azure-functions-puppeteer-pdf-razor-template/ (Please check the last section "Deploy to Azure")

    So you can try deploying to Function app on Linux platform and check if it is working.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.