Skip to content

Commit

Permalink
fix(ci): attempt to use playwright-core
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Feb 5, 2023
1 parent 5ec5a66 commit c0ebc04
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/runtime/nitro/providers/browser/node.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { isCI } from 'std-env'
import playwrightCore from 'playwright-core'

export default async function createBrowser() {
// try to use a local chrome instance over downloading binaries
try {
const playwrightCore = await import(String('playwright-core'))
// try use a local chrome instance over downloading binaries
const { Launcher } = await import(String('chrome-launcher'))
const chromePath = Launcher.getFirstInstallation()
return await playwrightCore.chromium.launch({
Expand All @@ -12,6 +12,13 @@ export default async function createBrowser() {
})
}
catch (e) {}
// try just using the core playwright to launch chromium
try {
return await playwrightCore.chromium.launch({
headless: true,
})
}
catch (e) {}
try {
const playwright = await import(String('playwright'))
return await playwright.chromium.launch({
Expand Down

0 comments on commit c0ebc04

Please sign in to comment.