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:
2026-04-07 18:02:33 +03:00
parent 36f8b8c0ca
commit 02630e4919
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ export class AuthService {
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 {
const context = await browser.newContext();
const page = await context.newPage();
+2 -2
View File
@@ -44,7 +44,7 @@ export class BrowserService {
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 {
const context = await browser.newContext();
@@ -112,7 +112,7 @@ export class BrowserService {
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 {
const context = await browser.newContext();
await context.addCookies(cookies);
+1 -1
View File
@@ -144,7 +144,7 @@ export class ScenarioSchedulerService {
const cookies: unknown[] = JSON.parse(session.cookies);
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 {
const context = await browser.newContext();
await context.addCookies(cookies as Parameters<typeof context.addCookies>[0]);