From 2bce29e3cb443270198d16a9a59c9eafa1efa89c Mon Sep 17 00:00:00 2001 From: Marco Ochse Date: Tue, 12 Sep 2023 11:01:49 +0200 Subject: [PATCH] Allow for Screenshot within Docker Chromium in Docker needs to be startet without sandbox or screenshot will fail. --- api/screenshot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/screenshot.js b/api/screenshot.js index c68f27e6..9345f14c 100644 --- a/api/screenshot.js +++ b/api/screenshot.js @@ -21,7 +21,7 @@ const handler = async (targetUrl) => { let browser = null; try { browser = await puppeteer.launch({ - args: chromium.args, + args: [...chromium.args, '--no-sandbox'], // Add --no-sandbox flag defaultViewport: { width: 800, height: 600 }, executablePath: process.env.CHROME_PATH || await chromium.executablePath, headless: chromium.headless,