There was an error while loading. Please reload this page.
1 parent e678159 commit ecb279aCopy full SHA for ecb279a
1 file changed
src/testing/puppeteer/puppeteer-browser.ts
@@ -67,11 +67,16 @@ export async function startPuppeteerBrowser(config: ValidatedConfig) {
67
devtools: config.testing.browserDevtools,
68
...connectOpts,
69
};
70
- launchOpts.executablePath =
71
- process.env.PUPPETEER_EXECUTABLE_PATH ||
72
- process.env.CHROME_PATH ||
73
- (puppeteer.executablePath as typeof executablePath)(launchOpts);
74
-
+ try {
+ // puppeteer >= 23
+ launchOpts.executablePath =
+ process.env.PUPPETEER_EXECUTABLE_PATH ||
+ process.env.CHROME_PATH ||
75
+ (puppeteer.executablePath as typeof executablePath)(launchOpts);
76
+ } catch (_) {
77
+ // puppeteer <= 22
78
+ launchOpts.executablePath = puppeteer.executablePath(launchOpts.channel);
79
+ }
80
browser = await (puppeteer.launch as typeof launch)({ ...launchOpts });
81
}
82
0 commit comments