fix: raise Puppeteer timeouts to 120s for 99-page illustrated book

Default 30s is too short when loading and rendering many local images.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-04 21:16:32 +02:00
parent ae443f1eab
commit f6f15a376e
+6 -1
View File
@@ -97,7 +97,11 @@ async function generate() {
});
const page = await browser.newPage();
await page.goto(`file://${inputPath}`, { waitUntil: 'networkidle0' });
// Large illustrated books with many local images need generous timeouts
page.setDefaultNavigationTimeout(120_000);
page.setDefaultTimeout(120_000);
await page.goto(`file://${inputPath}`, { waitUntil: 'networkidle0', timeout: 120_000 });
// Write to temp file first so Ghostscript can read it
await page.pdf({
@@ -106,6 +110,7 @@ async function generate() {
height: '8.75in',
printBackground: true,
margin: { top: 0, bottom: 0, left: 0, right: 0 },
timeout: 120_000,
});
await browser.close();