You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get an error "Failed to launch the browser process!
/tmp/chromium: /tmp/chromium: cannot execute binary file
TROUBLESHOOTING: https://pptr.dev/troubleshooting" when running 'puppeteer.launch()'
Steps to Reproduce
constchromium=require('chromium');import{dirname}from'path';import{readdirSync}from'fs';exports.handler=async(event,context,callback)=>{letresult=null;letbrowser=null;try{// log tmp folder content to be sure that chromium was correctly extractedconstexecutablePath=awaitchromium.executablePath();constexecutableDir=dirname(executablePath);console.info({
executablePath,
executableDir,executableDirContent: readdirSync(executableDir),});// console output: // {"executablePath":"/tmp/chromium","executableDir":"/tmp","executableDirContent":["al2","chromium","fonts","libEGL.so","libGLESv2.so","libvk_swiftshader.so","libvulkan.so.1","vk_swiftshader_icd.json"]}browser=awaitpuppeteer.launch({args: chromium.args,defaultViewport: chromium.defaultViewport,executablePath: executablePath,headless: chromium.headless,ignoreHTTPSErrors: true,});}catch(error){returncallback(error);}finally{if(browser!==null){awaitbrowser.close();}}returncallback(null,result);};
Possible Solution
I don't have a solution, I just can say what I have already done to narrow down the search.
First I've run my test locally and during the local test I was able to receive pdf file.
Also I've checked that /tmp folder contains all neccesary executables, so seems they was unarchived are present in /tmp folder (see logs above)
Also it's worth notice that we use serverless + serverless-layer plugin. But 99% it doesn't affects this issue as I performed necessary checks. First I checked that the layer contains @Sparticuz/chromium, secondly it was imported from the layer, and thirdly the files were successfully unzipped into /tmp during the first call to executablePath() (see logs above).
The text was updated successfully, but these errors were encountered:
Environment
chromium
Version: ^121.0.0puppeteer
/puppeteer-core
Version: ^21.11.0nodejs16
Expected Behavior
Run chrome, load html page and store as PDF
Current Behavior
Get an error "Failed to launch the browser process!
/tmp/chromium: /tmp/chromium: cannot execute binary file
TROUBLESHOOTING: https://pptr.dev/troubleshooting" when running 'puppeteer.launch()'
Steps to Reproduce
Possible Solution
I don't have a solution, I just can say what I have already done to narrow down the search.
First I've run my test locally and during the local test I was able to receive pdf file.
Also I've checked that /tmp folder contains all neccesary executables, so seems they was unarchived are present in /tmp folder (see logs above)
Also it's worth notice that we use serverless + serverless-layer plugin. But 99% it doesn't affects this issue as I performed necessary checks. First I checked that the layer contains @Sparticuz/chromium, secondly it was imported from the layer, and thirdly the files were successfully unzipped into /tmp during the first call to executablePath() (see logs above).
The text was updated successfully, but these errors were encountered: