All Questions
Tagged with webassembly go
141
questions
0
votes
0
answers
37
views
I keep getting a deadlock error any time i attempt to make an api call in golang compiled to wasm
As the title describes i am trying to make an api call in golang that is compiled to wasm it works fine when it is run on a machine but returns a deadlock error all go routines asleep whenever i run ...
1
vote
1
answer
34
views
How do I import a golang compiled WASM function into js and use it?
I am trying to import a function from my golang WASM file to use in javascript but anytime i try and use the function i get a undefined error. But if i import my WASM file and then use the console i ...
1
vote
0
answers
104
views
Error loading WASM module: [TypeError: WebAssembly.instantiate(): Import #0 module="go" error: module is not an object or function]
Hey guys i stuck on try to pass connection from nodejs to wasm. i successfully deploy it using "node server.js" it open on localhost port 8080. but when i want to test the result
this is the ...
1
vote
0
answers
16
views
Handle 'select' or 'click' event on vgform:Select
I have been using Vugu to build an internal dashboard, however I can't see how to register an event listener for a change/click/select event on a select dropdown box.
For example:
<vgform:Select ...
1
vote
1
answer
76
views
Exporting Go program to WASM - build constraints exclude all Go files
I'm trying to compile a specific go program to WASM: https://github.com/protomaps/go-pmtiles
Using this command: GOOS=js GOARCH=wasm go build -o go.wasm main.go gives me a following error:
package ...
1
vote
0
answers
53
views
import a stdout of wasm file created from go fileand fetch in nodejs
I have the following go file converted to xxx.wasm. I have the executable of main.go build but it cannot be built in every machine this package is imported.
Following is the wasm code i am using
index....
1
vote
1
answer
152
views
How can I perform a set of crud REST api with tinygo?
I'm currently working on a personal project. Notably to discover the possibilities of Web Assembly and Tinygo.
I have a small project which use vanilla.js and a simple index.html containing a button. ...
1
vote
0
answers
31
views
how to get the Golang function pointer and the external program can call this function by the pointer?
First call the update function, and then call an asynchronous function ic0.Call_new. Pass the pointer address of the callback function ic.Call_new as a parameter. The host env will call the callback ...
2
votes
0
answers
84
views
How to export wasm method from tinygo to allow spaces
I need the export wasm function to contain space, but the export fail
source file:
//go:export canister_query get
func get() uint32 {
return 0
}
build cmd
tinygo build -o counter.wasm -target=...
1
vote
0
answers
135
views
golang wasm:Remove the content of golang compilation wasm import wasi_snapshot_preview1
When I use Golang to compile into wasm, (import "wasi_snapshot_preview1" "fd_write" (func $runtime.fd_write (type 2))) will be introduced, but the environment running wasm does not ...
1
vote
1
answer
372
views
golang/wasm error (Uncaught (in promise) TypeError: import object field 'gojs' is not an Object)
Ive been using Golang and WASM to make a basic app (a basic game, but its not really that important to this question as you will soon find out) and learn about the technologies, so I set up a project ...
1
vote
0
answers
75
views
Ebiten wasm won't load
I'm trying to load Ebiten into Wasm using the command go run github.com/hajimehoshi/wasmserve@latest ., but when I go to try and load the localhost:8080 I just get an indefinite black screen. The ...
1
vote
1
answer
329
views
How can I compile Raylib to WASM in Golang?
I'm trying to compile Raylib to WASM in Golang, but when I run the command env GOOS=js GOARCH=wasm go build . Go can't seem to compile rcamera, and it gives me the following error message
# github.com/...
0
votes
1
answer
109
views
go wasm impl simple await raise error "fatal error: all goroutines are asleep - deadlock!"
following is my code
package main
import (
"fmt"
"syscall/js"
)
func main() {
js.Global().Set("testMethInWasm", js.FuncOf(func(this js.Value, args []js....
0
votes
0
answers
56
views
How to impl go wasm promise await
here is my code
func Await(p js.Value) js.Value {
var r js.Value
var e string
done := make(chan struct{})
p.Call("then", js.FuncOf(func(this js.Value, args []js.Value) ...