Open
Description
As the description, the module provider runtime for WebAssembly modules.
I used AssemblyScript
to compile the typescript file to wasm.
export function add(x: u64, y: u64): u64 {
return x + y;
}
Then, using the webassembly
to run the module,
require("webassembly")
.load("main.wasm")
.then(module => {
console.log("1 + 2 = " + module.exports.add(1, 2));
});
I got the error below
(node:92224) UnhandledPromiseRejectionWarning: TypeError: wasm function signature contains illegal type
at require.load.then.module (/Users/Peng/Downloads/wasm-project-yolspucnghl/out/program.js:7:45)
(node:92224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:92224) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Is there a gap between the AssemblyScript
and webassembly
?
And is there a node.js module to run the webassembly modules that AseemblyScript
compiled.
Metadata
Metadata
Assignees
Labels
No labels