Skip to content

Commit 716f84c

Browse files
committed
perf: ⚡ Wait until domcontentloaded before creating pdf
1 parent 98810fc commit 716f84c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/api/src/invoice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const plugin = new Elysia()
1111
let browser = await puppeteer.launch({ headless: true });
1212
const page = await browser.newPage();
1313

14-
await page.goto(`https://app.invoicelink.io/invoice?id=${id}&type=${type}&download=${download}`);
14+
await page.goto(`https://app.invoicelink.io/invoice?id=${id}&type=${type}&download=${download}`,{ waitUntil: 'domcontentloaded' });
1515
const pdf = await page.pdf({
1616
format: 'A4',
1717
printBackground: true

0 commit comments

Comments
 (0)