Skip to content

(node:91015) UnhandledPromiseRejectionWarning: TypeError: wasm function signature contains illegal type #26

Open
@LiaoPeng

Description

@LiaoPeng

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions