Skip to content

Commit

Permalink
Fix puppeteer import (vercel#145)
Browse files Browse the repository at this point in the history
TypeError: Cannot read property '_launcher' of undefined
  • Loading branch information
styfle authored Jan 9, 2021
1 parent f7961ce commit 7d87967
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/_lib/chromium.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { launch, Page } from 'puppeteer-core';
import core from 'puppeteer-core';
import { getOptions } from './options';
import { FileType } from './types';
let _page: Page | null;
let _page: core.Page | null;

async function getPage(isDev: boolean) {
if (_page) {
return _page;
}
const options = await getOptions(isDev);
const browser = await launch(options);
const browser = await core.launch(options);
_page = await browser.newPage();
return _page;
}
Expand Down

0 comments on commit 7d87967

Please sign in to comment.