Azure FunctionApp - Starter Kit issues
-
I'm working through setting up a new instance of the Azure FunctionApp Starter Kit.
I've had good luck running this in the past, but am running into some issues with a new install on Node 20LTS, Linux, Consumption plan.
After following the instructions to install, it works great locally at 5488, and deploys to Azure with no issue. But, any report called via the API generates the following error in the console:
Error: Failed to launch the browser process! /tmp/chromium: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory TROUBLESHOOTING: https://pptr.dev/troubleshooting at Interface.onClose (/home/site/wwwroot/node_modules/@puppeteer/browsers/lib/cjs/launch.js:310:24) at Interface.emit (node:events:530:35) at Interface.close (node:internal/readline/interface:530:10) at Socket.onend (node:internal/readline/interface:256:10) at Socket.emit (node:events:530:35) at endReadableNT (node:internal/streams/readable:1698:12) at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
I think this is related to the puppeteer issue mentioned elsewhere - but I cannot seem to find a way around it.
I've tried disabling the sandbox in jsreport.config.json:
{ "chrome": { "launchOptions": { "args": [ "--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage", "--disable-gpu", "--no-first-run", "--no-zygote", "--disable-extensions" ] } } }
I've tried similar in launch.json though I'm not sure this is a valid way to do this:
{ "version": "0.2.0", "configurations": [ { "name": "Attach to Node Functions", "type": "node", "request": "attach", "port": 9229, "preLaunchTask": "func: host start", "chrome": { "launchOptions": { "args": ["--no-sandbox"] } } } ] }
I'm kind of at a loss. Any ideas?
-
I apologize for the delay. I had to make sure Azure broke things really badly...
Unfortunately, Azure changed the libraries installed in the Azure Functions runtime. This affected Chromium, which currently doesn't work there. The only option is to use Docker or a premium plan and install the missing libs.
However, the better option is now to use Azure Container Apps. This lets you serverless host jsreport in a container with no missing lib issues.
I've updated docs and added this tutorial on how to get started with running jsreport in the Azure Container App.
https://jsreport.net/learn/azure-container-apps