We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f6c826 commit 3c2f493Copy full SHA for 3c2f493
1 file changed
src/utils/pdf.ts
@@ -22,8 +22,16 @@ export async function convertHtmlToPdf(
22
debugDumpHtml: boolean = false,
23
baseDir?: string
24
): Promise<void> {
25
+ const defaultArgs = ["--allow-file-access-from-files", "--enable-local-file-accesses"];
26
+
27
+ // On many CI runners (including GitHub Actions) Chromium's sandbox is not
28
+ // available. Passing these flags avoids the "No usable sandbox" failure.
29
+ if (process.env.CI || process.env.GITHUB_ACTIONS) {
30
+ defaultArgs.push("--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage");
31
+ }
32
33
const browser = await puppeteer.launch({
- args: ["--allow-file-access-from-files", "--enable-local-file-accesses"],
34
+ args: defaultArgs,
35
});
36
const page = await browser.newPage();
37
0 commit comments