deno-puppeteer icon indicating copy to clipboard operation
deno-puppeteer copied to clipboard

TypeError: reader is not async iterable at getReadableStreamAsUint8Array

Open mflisikowski opened this issue 2 years ago • 9 comments

Deno info:

🐉 >deno info
DENO_DIR location: /Users/mateuszflisikowski/Library/Caches/deno
Remote modules cache: /Users/mateuszflisikowski/Library/Caches/deno/deps
npm modules cache: /Users/mateuszflisikowski/Library/Caches/deno/npm
Emitted modules cache: /Users/mateuszflisikowski/Library/Caches/deno/gen
Language server registries cache: /Users/mateuszflisikowski/Library/Caches/deno/registries
Origin storage: /Users/mateuszflisikowski/Library/Caches/deno/location_data

TypeError: reader is not async iterable

TypeError: reader is not async iterable
    at getReadableStreamAsUint8Array (https://deno.land/x/[email protected]/vendor/puppeteer-core/puppeteer/common/util.js:329:29)
    at Page.pdf (https://deno.land/x/[email protected]/vendor/puppeteer-core/puppeteer/common/Page.js:2606:24)
    at async Server.<anonymous> (file:///home/deno/functions/download-cv/index.ts:21:17)
    at async Server.#respond (https://deno.land/[email protected]/http/server.ts:298:18)

Supabase function code, that try to run.

import puppeteer from 'https://deno.land/x/[email protected]/mod.ts';
import { serve } from 'https://deno.land/[email protected]/http/server.ts';

serve(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();

  await page.goto('https://mflisikowski.dev/cv', {
    waitUntil: 'networkidle2',
  });

  const pdf = await page.pdf({ format: 'A4' });

  await browser.close();

  return new Response(pdf, {
    headers: {
      'Content-Disposition': `attachment; filename="cv.pdf"`,
      'Content-Type': 'application/pdf',
    },
  });
});

mflisikowski avatar Dec 27 '22 16:12 mflisikowski

Same here, same as #67
Probably it's worth waiting for https://github.com/denoland/deno/issues/18913 so we can use Puppeteer from npm and have it always updated

danilopolani avatar May 22 '23 10:05 danilopolani

I also have the same problem using Superbase edge functions and browserless

PhilippS93 avatar Sep 29 '23 15:09 PhilippS93

any updates on solving this issue?

drobles-atdev avatar Oct 09 '23 16:10 drobles-atdev

Im also running into this error after calling page.pdf on a supabase edge function. Would love to get updates

julianolm avatar Oct 12 '23 03:10 julianolm