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
wasm_exec.html (+.js): LinkError: WebAssembly.instantiate(): #34424
Comments
You are likely using a different wasm_exec.js than your Go version. Please check that. And if you still see this issue, please mention the exact steps to reproduce this issue. Thanks. |
Version of golang and scripts -- best fresh. Its not different. Im repeat on my computer examples for WebAssembly (in this wiki on github). This message of errors -- in Chrome-console . |
Please mention the exact steps that you did. If you have exactly followed https://github.com/golang/go/wiki/WebAssembly#getting-started, there shouldn't be any errors. |
Im now repeat all step in examples.
Files for run examples:
If im go to page http://localhost:8000/wasm_exec.html -- get in console this error:
It's error raise not in bin-wasm. It's raised in JavaScript module -- not find true parametrs for call. if im go to page http://localhost:8000/ -- get in console this error:
If in this situation make good work of head -- naturaly -- this same error. |
Hi @prospero78 , perhaps there is a language barrier here due to which I am unable to explain what is required here. We need the exact commands that you executed on your system. So that we understand what exactly you did. For example-
What is the exact command you ran ? Where is the source code ?
Again, what is the copy command you ran ? What is the value of %PATH% ? Note that %PATH% should be same as You mention Please also fill the output of We are looking for something like - the Go source file you compiled, the command you used to compile, the command used to copy the wasm_exec.js. Preferably, it should just be a list of shell commands we can copy paste and reproduce the issue. Hope that is clear now. |
I do not think that there is a language barrier here. Rather, it is a semantic barrier. If this barrier exists at all.
The source code is in the same directory as the compilation commands.
% PATH% - I installed it correctly (points to all directories used in the work). Strictly speaking, this was the equivalent correct example of my path (just too lazy to write all the paths completely).
My project directory is not located in the %GOPATH%\SRC directory, but in my case it does not matter.
No problems.
I copied wasm_exec.js via TotalCommander (with replacing an existing file, the file size is the same), so the copy command does not matter. I'm not new to golang, I'm doing everything right (at least my programmer skills allow me to work for money in a startup). The problem is not compilation, the problem wasm wasex_exec.js malfunctioning I'll try two options today:
|
Ok, may I ask you to just attach your Go source file and the wasm_exec.js you are using ? We can reproduce the issue on our side and see what's going wrong. |
No problems. Im now run this code in %GOPATH%\src -- this no have effects. This same error with /index.html (examples from wiki) and /wasm_exec.html (+wasm_exec.js from source golang). |
This works fine for me @prospero78.
I do not understand this clearly. Are you saying this code works if you keep it in $GOPATH/src, but it does not work if you use wasm_exec.js from the Go source ? |
I apologize for the misleading answer. |
Ok, I don't know how else to proceed here. It works for me inside or outside GOPATH. The error is very specific to an incorrect wasm_exec.js, so I don't know how a different path can lead to this. Others can investigate further. |
---------- Forwarded message ---------
From: Agniva De Sarker <notifications@github.com>
Date: Mon, Sep 23, 2019, 4:22 AM
Subject: Re: [golang/go] wasm_exec.html (+.js): LinkError:
WebAssembly.instantiate(): (#34424)
To: golang/go <go@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Ok, I don't know how else to proceed here. It works for me inside or
outside GOPATH. The error is very specific to an incorrect wasm_exec.js, so
I don't know how a different path can lead to this. Others can investigate
further.
VID_1547350429403.mp4
<https://drive.google.com/file/d/1B9LgrRAGgSr8q9REYfEJzQ0nSkUzZKYr6g/view?usp=drivesdk>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#34424?email_source=notifications&email_token=AKAIVT7DEPFPY3KWEP5V66LQLB4FBA5CNFSM4IYTSVJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7KDTBA#issuecomment-534002052>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKAIVT363YIC4XWP4L3BJNLQLB4FBANCNFSM4IYTSVJA>
.
|
Thank you all for the discussion, until there is no solution to this problem. |
Just a small note that you might get better and quicker help in a Go forum like The golang-nuts mailing list or Gophers Slack. More people will see your issue and help you out. This issue tracker is mainly for bugs and feature proposals. I will leave this open because it is not yet clear to me whether it is a bug or not. |
https://github.com/moketao/show_a_wasm_link_err visit index.wasmgo.err.html, get some err:
visit index.wasmgo.ok.html, all is well. |
I figured out what the problem was: when moving from version 1.13.1 to a newer one, the shuffling library changed. For proper operation it was necessary to remove everything and install from the very beginning (as during the first installation). After that, everything starts to work. The topic can be closed. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Error in execute in brouser bin code on wasm
What did you see instead?
LinkError: WebAssembly.instantiate(): Import #18 module="go" function="syscall/js.copyBytesToJS" error: function import requires a callable
(anonymous) @ wasm_exec.html:36
Promise.catch (async)
(anonymous) @ wasm_exec.html:35
The text was updated successfully, but these errors were encountered: