From afbb42921768e673adeee477316014c95221a3c1 Mon Sep 17 00:00:00 2001 From: Andrew Radulescu Date: Thu, 29 Aug 2024 10:42:28 +0300 Subject: [PATCH] feat: [Contracts] Configure puppeteer to run headless --- backend/src/common/helpers/pdf-from-html.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/common/helpers/pdf-from-html.ts b/backend/src/common/helpers/pdf-from-html.ts index fae9d707..0d56de21 100644 --- a/backend/src/common/helpers/pdf-from-html.ts +++ b/backend/src/common/helpers/pdf-from-html.ts @@ -1,7 +1,10 @@ import puppeteer from 'puppeteer'; export const HTMLtoPDF = async (html: string): Promise => { - const browser = await puppeteer.launch(); + const browser = await puppeteer.launch({ + headless: true, + args: ['--no-sandbox', '--disable-setuid-sandbox'], + }); const page = await browser.newPage(); await page.setContent(html); const buffer = await page.pdf({ format: 'A4' });