Skip to content

Commit ac4351c

Browse files
authored
Update puppeteer.ts
1 parent 3f4d837 commit ac4351c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

api/_lib/puppeteer.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { launch, Page } from "puppeteer-core";
2-
import chrome from "chrome-aws-lambda";
2+
const chromium = require('@sparticuz/chromium')
33
let _page: Page | null;
44

55
async function getPage() {
66
if (_page) return _page;
77
const options = {
8-
args: chrome.args,
9-
executablePath: await chrome.executablePath,
10-
headless: chrome.headless,
8+
args: chromium.args,
9+
defaultViewport: chromium.defaultViewport,
10+
executablePath: await chromium.executablePath(),
11+
headless: chromium.headless,
1112
};
1213
const browser = await launch(options);
1314
_page = await browser.newPage();

0 commit comments

Comments
 (0)