fix(browser): pass executablePath from env var in all chromium.launch() calls
- system Chromium path from PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH was not forwarded to the launch options, causing 'executable doesn't exist' errors in Docker
This commit is contained in:
@@ -69,7 +69,7 @@ export class AuthService {
|
|||||||
throw new BadRequestException(`Key file not found: ${descriptor.keyFile}`);
|
throw new BadRequestException(`Key file not found: ${descriptor.keyFile}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const browser = await chromium.launch({ headless: true });
|
const browser = await chromium.launch({ headless: true, executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH });
|
||||||
try {
|
try {
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext();
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export class BrowserService {
|
|||||||
throw new InternalServerErrorException('Failed to deserialize session data', { cause: err });
|
throw new InternalServerErrorException('Failed to deserialize session data', { cause: err });
|
||||||
}
|
}
|
||||||
|
|
||||||
const browser = await chromium.launch({ headless: true });
|
const browser = await chromium.launch({ headless: true, executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH });
|
||||||
try {
|
try {
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext();
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ export class BrowserService {
|
|||||||
throw new InternalServerErrorException('Failed to deserialize session data', { cause: err });
|
throw new InternalServerErrorException('Failed to deserialize session data', { cause: err });
|
||||||
}
|
}
|
||||||
|
|
||||||
const browser = await chromium.launch({ headless: true });
|
const browser = await chromium.launch({ headless: true, executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH });
|
||||||
try {
|
try {
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext();
|
||||||
await context.addCookies(cookies);
|
await context.addCookies(cookies);
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export class ScenarioSchedulerService {
|
|||||||
const cookies: unknown[] = JSON.parse(session.cookies);
|
const cookies: unknown[] = JSON.parse(session.cookies);
|
||||||
const localStorageData: Record<string, string> = JSON.parse(session.localStorage);
|
const localStorageData: Record<string, string> = JSON.parse(session.localStorage);
|
||||||
|
|
||||||
const browser = await chromium.launch({ headless: true });
|
const browser = await chromium.launch({ headless: true, executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH });
|
||||||
try {
|
try {
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext();
|
||||||
await context.addCookies(cookies as Parameters<typeof context.addCookies>[0]);
|
await context.addCookies(cookies as Parameters<typeof context.addCookies>[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user