lino-levan / astral

A high-level puppeteer/playwright-like library for Deno
https://jsr.io/@astral/astral
MIT License
176 stars 7 forks source link

Export PDF cause `maxAttempts` error #74

Closed Jimdooz closed 9 hours ago

Jimdooz commented 3 weeks ago

When trying to export a PDF, I encounter a maxAttempts error

// Import Astral
import { launch } from "jsr:@astral/astral";

// Launch the browser
const browser = await launch();

// Open a new page
const page = await browser.newPage("https://deno.land");

// Create a pdf of the page and save that to disk
const pdfPage = await page.pdf();
Deno.writeFileSync("page.pdf", pdfPage);

// Close the browser
await browser.close();

Cause error

error: Uncaught (in promise) RetryError: Retrying exceeded the maxAttempts (5).
        throw new RetryError(error, options.maxAttempts);
              ^

Environnement

astral : v0.4.2 deno : v1.44.1 os : Windows 11, x64

lino-levan commented 3 weeks ago

This is an upstream bug on the latest chromium on windows unfortunately. I'm not really sure what to do about it. For now, you can pin a slightly older version of astral until this gets fixed by upstream.