DNAD
Deno2y 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)


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",
    ],
});


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

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 1.41.1 (release, aarch64-unknown-linux-gnu)
v8 12.1.285.27
typescript 5.3.3
image.png
Was this page helpful?