lightninglabs / lightning-node-connect

MIT License
79 stars 22 forks source link

`WebAssembly.instantiateStreaming` fails in example file #38

Closed neb-b closed 2 years ago

neb-b commented 2 years ago

I am trying to run the example in this repo with the example-server.go server but am seeing this error on page load:

LinkError: WebAssembly.instantiate(): Import #5 module="go" function="runtime.walltime1" error: function import requires a callable

The error happens at WebAssembly.instantiateStreaming here https://github.com/lightninglabs/lightning-node-connect/blob/master/example/index.html#L80-L84

I'm think it could be because I changed the fetch() url there ^ to prefix it with http://localhost:3000/. Without that, it tries to fetch from the file system file:///{...}/lightning/lightning-node-connect/example/wasm-client.wasm which gets blocked by cors

specs

mac M1 - 12.3.1 Monteray happens in all browsers

guggero commented 2 years ago

Does the error also happen if you run make example-server and load the page through http://localhost:8080? That's the intended way of running the example.

neb-b commented 2 years ago

Yeah. I see a 200 on the wasm-client.wasm request but still see the same error

guggero commented 2 years ago

What golagn version did you use to compile the wasm binary? I think you need to use 1.17.x

neb-b commented 2 years ago

That was it. I was using 1.16.9. Thanks