How to use WASM with a worker?

The Use from JavaScript section of this page suggests to place an await at the top level of a js file: https://developers.cloudflare.com/workers/runtime-apis/webassembly/javascript/#use-from-javascript However, when I try to do this with my project, I get an error like this:
ERROR: Top-level await is currently not supported with the "iife" output format
ERROR: Top-level await is currently not supported with the "iife" output format
Does anyone know what I can try for this?
Cloudflare Docs
Wasm in JavaScript · Cloudflare Workers docs
Wasm can be used from within a Worker written in JavaScript or TypeScript by importing a Wasm module, and instantiating an instance of this module …
2 Replies
kian
kian8mo ago
What’s your code?
andrew
andrewOP8mo ago
hmm, its part of a big project.. ill have to extract a minimal repro. i was hoping it was a common enough issue that there may be some general suggestions
Want results from more Discord servers?
Add your server