j11s
j11s2y ago

Deno debugging failure: Argument 0 must be a buffer source

I have TWO Deno project with and cannot use the debugger with ONE of them. One project debugs fine, the other does not. I do not know where to start to mitigate the problem. I see this problem with VS Code fronting the debugger and by using chrome://inspect directly. First, the error message:
/home/xxx/.local/bin/deno run --inspect-brk --allow-all src/xxx-api-server.ts
Uncaught TypeError TypeError: WebAssembly.compile(): Argument 0 must be a buffer source
at eventLoopTick (core/01_core.js:181:11)
01_core.js:181
Debugger listening on ws://127.0.0.1:9229/ws/e8d67075-6dae-493c-83d5-73d26738d2b9
Visit chrome://inspect to connect to the debugger.
Deno is waiting for debugger to connect.
Debugger session started.
error: Uncaught (in promise) TypeError: WebAssembly.compile(): Argument 0 must be a buffer source
at eventLoopTick (ext:core/01_core.js:181:11)
Process exited with code 1
/home/xxx/.local/bin/deno run --inspect-brk --allow-all src/xxx-api-server.ts
Uncaught TypeError TypeError: WebAssembly.compile(): Argument 0 must be a buffer source
at eventLoopTick (core/01_core.js:181:11)
01_core.js:181
Debugger listening on ws://127.0.0.1:9229/ws/e8d67075-6dae-493c-83d5-73d26738d2b9
Visit chrome://inspect to connect to the debugger.
Deno is waiting for debugger to connect.
Debugger session started.
error: Uncaught (in promise) TypeError: WebAssembly.compile(): Argument 0 must be a buffer source
at eventLoopTick (ext:core/01_core.js:181:11)
Process exited with code 1
System details: Deno 1.33.2 (have tried 1.33.1, too) VS Code 1.78.1 (and the previous version, as well) Plugin: Deno Plugin latest OS: both Linux and Windows The upshot is that there is something about this specific project that is causing a bug with the debugger. I don't know to whom I should report the problem (Deno or Google/Chrome). I'd be satisfied with a workaround to be able to debug it again, but I do not know where to start. Much thanks.
3 Replies
j11s
j11sOP2y ago
I've narrowed the issue down to DAX:
// example.ts
import $ from 'https://deno.land/x/dax@0.31.1/mod.ts'

console.log("IT RUNS")

console.dir($.commandExistsSync("ls"))

console.log("IT FINISHES")
// example.ts
import $ from 'https://deno.land/x/dax@0.31.1/mod.ts'

console.log("IT RUNS")

console.dir($.commandExistsSync("ls"))

console.log("IT FINISHES")
Debug with deno run --inspect-brk -A example.ts However, I can now run longer running deno apps with --inspect -- so that fixed my blocking problem with debugging for now. I still think there's a bug somewhere with Deno, Dax, the debugger in Chrome, etc.
dsherret
dsherret2y ago
I think it's this: https://github.com/denoland/deno/issues/15015 (bug in deno)
GitHub
deno_emit fails depending on whether or not a breakpoint is set. · ...
Not sure if this is a Deno issue, or a deno_emit issue, but it seems like debugging shouldn't affect the code like this so I'm assuming this is an issue with Deno. To reproduce: create emit...
j11s
j11sOP2y ago
yes, that's it. Thanks!

Did you find this page helpful?