Skip to content

wasm js.FuncOf returns error #226

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

Closed
Zambiorix opened this issue Mar 8, 2019 · 2 comments
Closed

wasm js.FuncOf returns error #226

Zambiorix opened this issue Mar 8, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@Zambiorix
Copy link

Zambiorix commented Mar 8, 2019

The code below compiles fine with tinygo but when running I get the following error:

(index):1 Uncaught (in promise) LinkError: WebAssembly Instantiation: Import #5 module="env" function="syscall/js.valueInvoke" error: function import requires a callable
Promise.then (async)
(anonymous) @ (index):45
js.Global().Get("window").Call("addEventListener", "beforeunload", js.NewEventCallback(0, func(event js.Value) {

}))

The code compiles and runs without a problem when using the default go compiler

Edit : the error pops up when I isolate the js.NewEventCallback call ..so that is the culprit

@aykevl
Copy link
Member

aykevl commented Mar 8, 2019

This has not yet been implemented, and will likely be implemented after #211.

@deadprogram deadprogram added the enhancement New feature or request label Mar 9, 2019
@aykevl aykevl changed the title wasm js.NewEventCallback returns error wasm js.FuncOf returns error May 13, 2019
@deadprogram
Copy link
Member

Code for this has just landed in the dev branch with this PR #367

Now losing, please reopen if needed. Thank you!

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

No branches or pull requests

3 participants