Full Puppeteer downloads a ~170MB Chrome that doesn't fit in a serverless function. The usual setup is puppeteer-core + @sparticuz/chromium (a trimmed Chromium built for Lambda-style environments):
import chromium from "@sparticuz/chromium";
import puppeteer from "puppeteer-core";
const browser = await puppeteer.launch({
args: chromium.args,
executablePath: await chromium.executablePath(),
headless: true,
});Match the @sparticuz/chromium major version to what your puppeteer-core version expects. Give the function enough memory (1GB+).