Encountered an issue while running the following code in index.ts using Deno:
const wasm = await Deno.readFile("./wasm_test/pkg/wasm_test_bg.wasm");
const wasmModule = new WebAssembly.Module(wasm);
const wasmInstance = new WebAssembly.Instance(wasmModule);
const wasmTest = wasmInstance.exports;
wasmTest.sum(1, 3); // Error
Error: This expression is not callable. No constituent of type 'ExportValue' is callable.
When attempting to call sum
, an error is thrown instead of returning the expected result of 4.
Interestingly, it works fine when run as index.js.
The Rust code was compiled using wasm-pack.