Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: Uncaught (in promise) BadResource: Bad resource ID #57

Open
jerrygreen opened this issue Aug 23, 2022 · 3 comments
Open

error: Uncaught (in promise) BadResource: Bad resource ID #57

jerrygreen opened this issue Aug 23, 2022 · 3 comments

Comments

@jerrygreen
Copy link

Just tried to run the example code from README:

PUPPETEER_PRODUCT=chrome deno run -A --unstable https://deno.land/x/[email protected]/install.ts

example.js / example.ts:

import puppeteer from "https://deno.land/x/[email protected]/mod.ts";

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("https://example.com");
await page.screenshot({ path: "example.png" });

await browser.close();

And then:

deno run -A --unstable example.ts

Which throws an error:

error: Uncaught (in promise) BadResource: Bad resource ID
    const result = await reader.read(inspectArr);
                   ^
    at async read (deno:runtime/js/12_io.js:105:19)
    at async readDelim (https://deno.land/[email protected]/io/bufio.ts:652:20)
    at async readStringDelim (https://deno.land/[email protected]/io/bufio.ts:702:20)
    at async readLines (https://deno.land/[email protected]/io/bufio.ts:711:18)
    at async waitForWSEndpoint (https://deno.land/x/[email protected]/src/deno/BrowserRunner.ts:167:20)
    at async BrowserRunner.setupConnection (https://deno.land/x/[email protected]/src/deno/BrowserRunner.ts:145:31)
    at async ChromeLauncher.launch (https://deno.land/x/[email protected]/src/deno/Launcher.ts:114:26)
    at async file:///home/ubuntu/Projects/deno-puppeteer/example.ts:3:17

Deno.version:

{ deno: "1.24.3", v8: "10.4.132.20", typescript: "4.7.4" }
@rottenpen
Copy link

denoland/deno#15479 maybe same as it

@jerrygreen
Copy link
Author

@rottenpen there's also this:

It's hard to tell if it's related to denoland/deno#15479. Although in both cases it mentions some reader, but there it includes deno:core/01_core.js, while in this issue here it's related to deno:runtime/js/12_io.js.

Might be related. Might be not.

P.S. Although I like Deno, for now I'm more inclined to use original NodeJS puppeteer, as a more reliable piece of software. Unfortunately. Maybe in future release when there will be support for npm packages, this issue won't be even needed to be resolved.

@abhiparate14
Copy link

@jerrygreen
did you find any solution for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants