emil
Explore posts from serversCDCloudflare Developers
•Created by emil on 8/2/2024 in #workers-help
"readable is not async iterable" generating PDF with @cloudflare/puppeteer + Browser Rendering
Steps to reproduce the problem:
Launch puppeteer and instantiate a Page with some content:
const browser = await puppeteer.launch(env.MYBROWSER);
const page = await browser.newPage();
await page.setContent('<h1>HELLO CLOUDFLARE</h1>', {
waitUntil: 'networkidle0',
});
Get the PDF:
await page.pdf({ displayHeaderFooter: true })
Yields this error:
TypeError: readable is not async iterable
at getReadableAsBuffer (file:///Users/emillienemann/Documents/Code/talktweak/ClientWork/Nory/nory-sales/noryautomations-hono/.wrangler/tmp/dev-Vj79kl/index.js:45046:31)
at Page2.pdf (file:///Users/emillienemann/Documents/Code/talktweak/ClientWork/Nory/nory-sales/noryautomations-hono/.wrangler/tmp/dev-Vj79kl/index.js:49130:26)
at async markdownToR2Pdf (file:///Users/emillienemann/Documents/Code/talktweak/ClientWork/Nory/nory-sales/noryautomations-hono/.wrangler/tmp/dev-Vj79kl/index.js:52861:18)
at async Array.<anonymous> (file:///Users/emillienemann/Documents/Code/talktweak/ClientWork/Nory/nory-sales/noryautomations-hono/.wrangler/tmp/dev-Vj79kl/index.js:52886:18)
at async drainBody (file:///Users/emillienemann/Documents/Code/talktweak/ClientWork/Nory/nory-sales/noryautomations-hono/.wrangler/tmp/dev-Vj79kl/index.js:53277:12) {
stack: TypeError: readable is not async iterable
at g…-hono/.wrangler/tmp/dev-Vj79kl/index.js:53277:12),
message: readable is not async iterable
}
GitHub issue + repo to reproduce: https://github.com/cloudflare/puppeteer/issues/371 replies