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:
+6
-1
@@ -97,7 +97,11 @@ async function generate() {
|
|||||||
});
|
});
|
||||||
const page = await browser.newPage();
|
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
|
// Write to temp file first so Ghostscript can read it
|
||||||
await page.pdf({
|
await page.pdf({
|
||||||
@@ -106,6 +110,7 @@ async function generate() {
|
|||||||
height: '8.75in',
|
height: '8.75in',
|
||||||
printBackground: true,
|
printBackground: true,
|
||||||
margin: { top: 0, bottom: 0, left: 0, right: 0 },
|
margin: { top: 0, bottom: 0, left: 0, right: 0 },
|
||||||
|
timeout: 120_000,
|
||||||
});
|
});
|
||||||
|
|
||||||
await browser.close();
|
await browser.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user