javascriptcasm.jswebassembly

LinkError: WebAssembly.instantiate() function import requires a callable


I am practicing WebAssembly at https://github.com/mikerourke/learn-webassembly.

I tried to check the result of "without-glue.html", the last step of "chapter-05-create-load-module".

But it didn't run normally and I got the below error.

LinkError: WebAssembly.instantiate(): Import #0 module="env" function="jsClearRect" error: function import requires a callable

I have checked the part of defining and loading the module in the html file, but I think there is no problem.

How can I solve this problem?


Solution

  • It's complaining because it expects a function named jsClearRect in the import object env, but there isn't one.

    There is a function named _jsClearRect though.