Treetop Flyer
Treetop Flyer
DDeno
Created by Treetop Flyer on 6/2/2024 in #help
Weird error with Promise<Deno.AtomicOperation>
When an async process returns a reference to an atomic operation:
const kv = await Deno.openKv();
// contrived async process:
new Promise( ok=>ok(kv.atomic()) );
const kv = await Deno.openKv();
// contrived async process:
new Promise( ok=>ok(kv.atomic()) );
it throws:
error: Uncaught (in promise) TypeError: `Deno.AtomicOperation` is not a promise. Did you forget to call `commit()`?
at AtomicOperation.then (ext:deno_kv/01_db.ts:413:11)
at eventLoopTick (ext:core/01_core.js:168:7)
error: Uncaught (in promise) TypeError: `Deno.AtomicOperation` is not a promise. Did you forget to call `commit()`?
at AtomicOperation.then (ext:deno_kv/01_db.ts:413:11)
at eventLoopTick (ext:core/01_core.js:168:7)
4 replies
DDeno
Created by Treetop Flyer on 4/23/2024 in #help
WASM version of SWC.RC errors only in debug mode
NOTE: This is a bare bones example just to illustrate the problem: we aren't transpiling anything just getting the wasm to init. basic setup: - swc.ts:
import init from "https://esm.sh/@swc/wasm-web";
await init();
import init from "https://esm.sh/@swc/wasm-web";
await init();
- .vscode/launch.json:
{"configurations": [{"name": "debug", "request": "attach", "type": "node"}]}
{"configurations": [{"name": "debug", "request": "attach", "type": "node"}]}
steps: In the CLI run:
deno run -A swc.ts
deno run -A swc.ts
It should just run and quit OK with no errors. Next in the CLI run with a debug flag:
deno run -A --inspect-wait swc.ts
deno run -A --inspect-wait swc.ts
and then attach the debugger (vscode: "Run and debug" the configured debugger ["debug"]). You should see the console error:
error: Uncaught (in promise) TypeError: WebAssembly.compile(): Argument 0 must be a buffer source
at eventLoopTick (ext:core/01_core.js:168:7)
error: Uncaught (in promise) TypeError: WebAssembly.compile(): Argument 0 must be a buffer source
at eventLoopTick (ext:core/01_core.js:168:7)
4 replies