We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f4d837 commit ac4351cCopy full SHA for ac4351c
api/_lib/puppeteer.ts
@@ -1,13 +1,14 @@
1
import { launch, Page } from "puppeteer-core";
2
-import chrome from "chrome-aws-lambda";
+const chromium = require('@sparticuz/chromium')
3
let _page: Page | null;
4
5
async function getPage() {
6
if (_page) return _page;
7
const options = {
8
- args: chrome.args,
9
- executablePath: await chrome.executablePath,
10
- headless: chrome.headless,
+ args: chromium.args,
+ defaultViewport: chromium.defaultViewport,
+ executablePath: await chromium.executablePath(),
11
+ headless: chromium.headless,
12
};
13
const browser = await launch(options);
14
_page = await browser.newPage();
0 commit comments