DenoDDeno
Powered by
Treetop FlyerT
Deno•2y ago•
3 replies
Treetop Flyer

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)
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Weird behaviour with deno autocomplete
StéphaneSStéphane / help
2y ago
Weird Deno Type Safety
CrypticCCryptic / help
17mo ago