Im trying to instantiate a .wasm file locally in node.js. The goal is to run the binary locally and reproduce the functionalities of the web page. Here's my minimum reproducable example:
const fetch = require("node-fetch");
const importObject = {
imports: {
imported_func: function(arg) {
console.log(arg);
}
}
};
fetch('https://www.supremenewyork.com/ticket.wasm').then(response =>
response.arrayBuffer()
).then(bytes => {
let mod = new WebAssembly.Module(bytes);
let instance = new WebAssembly.Instance(mod, importObject);
instance.exports.exported_func();
})
The error i get is: TypeError: WebAssembly.Instance(): Import #0 module="wasi_unstable" error: module is not an object or function
I saw some questions with similar problems but no real solutions were provided. This is my first time working with wasm so im pretty lost.
Thanks for your help.