-
Notifications
You must be signed in to change notification settings - Fork 18k
can't run wasm module in browser: LinkError: WebAssembly Instantiation #29827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do not copy from master branch. Use the files from your distribution as mentioned in the wiki page.
If the issue still persists after you have copied the correct files, please let us know. |
Thanks much for the suggestion. I copied the relevant files from the release-branch.go1.11 branch and it works as advertised. Just as an aside, I'm using Fedora 29 and though I used dnf to install go, my GOROOT doesn't have any of the wasm related files for whatever reason. |
|
had the same issue, also using Fedora 29, my GOROOT has no wasm related files, and it's Go 1.11. just thought someone should know. |
I do not know much about |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I don't know yet. All the example code I've seen runs on go 1.11
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I tried following various example of how to get a wasm module compiled via golang to work in the browser, primarily: https://github.com/golang/go/wiki/WebAssembly
hello.go
Compiled into wasm module via:
I then copied the js / html fiels for running wasm in browser via:
https://github.com/golang/go/tree/master/misc/wasm
Lastly, I created simple http server to serve up the assets:
What did you expect to see?
I expected to see a active button, so that when clicked it was display "hello world" in the browser console
What did you see instead?
Uncaught (in promise) LinkError: WebAssembly Instantiation: Import #5 module="go" function="runtime.scheduleCallback" error: function import requires a callable
The text was updated successfully, but these errors were encountered: