-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
Go 1.17: LinkError: import object field 'runtime.walltime' is not a Function #569
Comments
I will take a look on it. Thanks for reporting it. |
I just ran into this as well, and from looking up the information about WASM from the Go devs, it sounds like there is a history about that wasm_exec.js file changing between versions of Go, so a static-version of that file in the go-app repo is probably not a good idea for future version updates either. It looks like the wasm_exec.js that is used needs to come from the current version of the go compiler installed on the system doing the build - since the Go devs ensure that the wasm_exec.js distributed with Go is always compatible, but that file has no backward/forward compatibility guarantee. That file is located at "/usr/share/go/misc/wasm/wasm_exec.js" on my Linux system here, but I think you can dynamically fetch the go installation path within go itself and just copy that file at build-time instead. |
More info: So a short-term solution would be to just release a new package for go-app (v9-XYZ) which was build on a system using Go 1.17 Longer term: a way to move that generation routine out of the go-app pre-packaging framework (go generate) and into some kind of "setup routine" that a developer can run/re-run on their system as needed instead. Alternatively, I think I have seen other go-based WASM systems actually drop the wasm_exec.js file into the root dir of the files for the site itself, and then the server dynamically reads/uses that file (with caching as needed) instead of having a static string in memory. |
Hey, yes so it looks like they have changed some stuff in the js support file. I'll release v9 with the 1.17 requirement. in the meantime you can get a v9 build where it is fixed with this:
Working on releasing v9 soon. |
That new v9 tag works great on my go 1.17 system. Thanks! |
Import #5 module="go" function="runtime.walltime" error: function import requires a callable maxence-charriere/go-app#569
I updated my Go compiler and it looks like wasm_exec.js got updated within the runtime so launching the WASM failed with
LinkError: import object field 'runtime.walltime' is not a Function
It looks like walltime1() is used in the static generated script.go whereas Go 1.17 changed from walltime1() to walltime() hence the missing function exception.
The text was updated successfully, but these errors were encountered: