DenoDDeno
Powered by
DNAD
Deno•3y ago•
64 replies
DNA

Puppeteer: "BadResource: Bad resource ID" on Ubuntu

Hello, i just switched my server os over to ubuntu server 23.10. When executing my script, it immediately throws an error an exits. Before, on my windows machine, the script worked completely fine.

Error:
error: Uncaught (in promise) BadResource: Bad resource ID
    const result = await reader.read(inspectArr);
                                ^
    at read (ext:deno_io/12_io.js:116:28)
    at FsFile.read (ext:deno_fs/30_fs.js:706:12)
    at readDelim (https://deno.land/std@0.93.0/io/bufio.ts:652:33)
    at readDelim.next (<anonymous>)
    at readStringDelim (https://deno.land/std@0.93.0/io/bufio.ts:702:20)
    at readStringDelim.next (<anonymous>)
    at readLines (https://deno.land/std@0.93.0/io/bufio.ts:711:18)
    at readLines.next (<anonymous>)
    at waitForWSEndpoint (https://deno.land/x/puppeteer@16.2.0/src/deno/BrowserRunner.ts:168:20)
    at eventLoopTick (ext:core/01_core.js:166:7)
error: Uncaught (in promise) BadResource: Bad resource ID
    const result = await reader.read(inspectArr);
                                ^
    at read (ext:deno_io/12_io.js:116:28)
    at FsFile.read (ext:deno_fs/30_fs.js:706:12)
    at readDelim (https://deno.land/std@0.93.0/io/bufio.ts:652:33)
    at readDelim.next (<anonymous>)
    at readStringDelim (https://deno.land/std@0.93.0/io/bufio.ts:702:20)
    at readStringDelim.next (<anonymous>)
    at readLines (https://deno.land/std@0.93.0/io/bufio.ts:711:18)
    at readLines.next (<anonymous>)
    at waitForWSEndpoint (https://deno.land/x/puppeteer@16.2.0/src/deno/BrowserRunner.ts:168:20)
    at eventLoopTick (ext:core/01_core.js:166:7)


Relevant code:
import puppeteer from "https://deno.land/x/puppeteer@16.2.0/mod.ts";
import * as path from "https://deno.land/std@0.197.0/path/mod.ts";

const browser = await puppeteer.launch({
    headless: true,
    product: "chrome",
    defaultViewport: {width: 1280, height: 720},
    args: [
        //
        `--disable-extensions-except=${path.join(Deno.cwd(), "extensions", "cjpalhdlnbpafiamejdnhcphjbkeiagm", "1.50.0_0")}`,
        `--load-extension=${path.join(Deno.cwd(), "extensions", "cjpalhdlnbpafiamejdnhcphjbkeiagm", "1.50.0_0")}`,
        "--mute-audio",
    ],
});
import puppeteer from "https://deno.land/x/puppeteer@16.2.0/mod.ts";
import * as path from "https://deno.land/std@0.197.0/path/mod.ts";

const browser = await puppeteer.launch({
    headless: true,
    product: "chrome",
    defaultViewport: {width: 1280, height: 720},
    args: [
        //
        `--disable-extensions-except=${path.join(Deno.cwd(), "extensions", "cjpalhdlnbpafiamejdnhcphjbkeiagm", "1.50.0_0")}`,
        `--load-extension=${path.join(Deno.cwd(), "extensions", "cjpalhdlnbpafiamejdnhcphjbkeiagm", "1.50.0_0")}`,
        "--mute-audio",
    ],
});


Troubleshooting steps taken:
- Re-ran installation script
- Cleared cache
- Rebooted machine

uname -a
uname -a
:
Linux dnarpi 6.5.0-1011-raspi #14-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 9 14:06:28 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

deno --version
deno --version
:
deno 1.41.1 (release, aarch64-unknown-linux-gnu)
v8 12.1.285.27
typescript 5.3.3
image.png
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements
Next page

Similar Threads

error: BadResource: Bad resource ID
v1rtlVv1rtl / help
3y ago
Bad resource ID ERROR
nekodendislikeNnekodendislike / help
14mo ago
Why Bad resource ID occurs?
jeieaJjeiea / help
3y ago
Streaming download throws `Bad resource ID`
vwkdVvwkd / help
2y ago