Skip to content
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

examples seem broken #5

Open
maddyblue opened this issue Jan 10, 2020 · 3 comments
Open

examples seem broken #5

maddyblue opened this issue Jan 10, 2020 · 3 comments

Comments

@maddyblue
Copy link

Both of the examples seem broken. I'm on go1.13.5. The caller example uses a non-existent FromBytes function. The http example errors with:

panic: Failed to instantiate the module:
    2 link errors: (1 of 2) Import not found, namespace: go, name: syscall/js.copyBytesToGo (2 of 2) Import not found, namespace: go, name: syscall/js.copyBytesToJS

in the BridgeFromFile function.

@maddyblue
Copy link
Author

If I use the main.wasm file from this repo it works. But if I compile it myself (from the examples/http-wasm directory):

GOOS=js GOARCH=wasm go build

then the above error occurs. How did you produce the .wasm files in this repo?

@vedhavyas
Copy link
Collaborator

@mjibson could you tell me the Go version you are using ?
ATM, it only supports go 1.13 since there are breaking changes in next or previous versions of Go since WASM is not in Go1 compatibilty

@vedhavyas
Copy link
Collaborator

You can re build wasm like this

GOOS=js GOARCH=wasm go build -o main.wasm ./examples/function-wasm/...
GOOS=js GOARCH=wasm go build -o main.wasm ./examples/http-wasm/...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants