Hey guys!
I’m trying to create netlify function that can capture a screenshot with puppeteer.
Build & deploy works ok, but I see issue “Cannot find module ‘chrome-aws-lambda’”
chrome-aws-lambda & pupeeter-core are added as dependencies
const chromium = require("chrome-aws-lambda");
const puppeteer = require("puppeteer-core");
...
export const task = async () => {
const executablePath = await chromium.executablePath;
const browser = await puppeteer.launch({
args: chromium.args,
executablePath: executablePath,
headless: chromium.headless,
});
const page = await browser.newPage();
...
// package.json
"dependencies": {
"chrome-aws-lambda": "^10.1.0",
"puppeteer-core": "^10.4.0"
}
Do you have any idea why?