-
-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
chromiumVersion:107puppeteer/puppeteer-coreVersion:^18.1.0- Node.js Version: 16.x
- Lambda / GCF Runtime:
nodejs16.x,arm64
Expected Behavior
chrome doesn't crash
Current Behavior
on puppeteer browser start,
Error: Failed to launch the browser process!
/tmp/chromium: /tmp/chromium: cannot execute binary file
Steps to Reproduce
create a lambda with arm64 architecture (Architectures: ["arm64"])
invoke the following code
const chromium = require('@sparticuz/chromium')
const puppeteer = require('puppeteer-core')
exports.handler = async (event, context, callback) => {
let result = null;
let browser = null;
try {
browser = await puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath,
headless: chromium.headless,
ignoreHTTPSErrors: true,
});
} catch (error) {
return callback(error);
} finally {
if (browser !== null) {
await browser.close();
}
}
return callback(null, result);
};Possible Solution
This is likely because the chromium binary is compiled using x64 as a target.
I believe that for it to work properly, there should be ansible steps to compile for arm, and two different binaries should be present here, then either based on runtime environment detection or based on arguments, the correct executable should be used.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working