Compiles and instantiates a TeaVM WebAssembly GC module.
Call this at module scope. workerd permits WebAssembly compilation only during module
evaluation; the same call inside a request handler throws
CompileError: Wasm code generation disallowed by embedder. The whole path is synchronous
on purpose, because the asynchronous forms are unavailable at module scope: a
WebAssembly.compile promise never settles there, and WebAssembly.compileStreaming
refuses outright as asynchronous I/O.
TeaVM's runtime has the same constraint for a second reason. Its JavaScript interop builds
@JSBody bodies with new Function, which workerd allows during module evaluation and answers
with EvalError in a request.
Compiles and instantiates a TeaVM WebAssembly GC module.
Call this at module scope. workerd permits WebAssembly compilation only during module evaluation; the same call inside a request handler throws
CompileError: Wasm code generation disallowed by embedder. The whole path is synchronous on purpose, because the asynchronous forms are unavailable at module scope: aWebAssembly.compilepromise never settles there, andWebAssembly.compileStreamingrefuses outright as asynchronous I/O.TeaVM's runtime has the same constraint for a second reason. Its JavaScript interop builds
@JSBodybodies withnew Function, which workerd allows during module evaluation and answers withEvalErrorin a request.