Fix puppeteer import (#145)
TypeError: Cannot read property '_launcher' of undefined
This commit is contained in:
parent
f7961ce7a4
commit
7d879675da
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue