-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: fatal error: all goroutines are asleep - deadlock! #34478
Comments
As https://golang.org/pkg/syscall/js/#FuncOf says:
currently, blocking operation, such as channel send, doesn't work in callbacks. |
@cherrymui Thanks for the fast reply! If I start a new goroutine |
I think it is not guaranteed to be executed sequentially, just like the |
@cherrymui Yeah, just tried it and it's async - is there any workaround? |
There is none at the moment. If you are making any call to JS land from inside a wrapped function, it's a deadlock. You have to change your programming model accordingly. |
@cherrymui, @neelance: should we keep this issue open to track a future improvement to relax this restriction, or is it going to remain this way for the foreseeable future? |
@bcmills I don't see any way to relax this restriction. @danaugrs Btw: You can use |
Version: go1.13 windows/amd64
Does this issue reproduce with the latest release? Yes
go env
OutputMinimal Reproducible Example
What did you expect to see?
I expected
doStuffSynchronously()
to work inside a callback just like it works outside one.What did you see instead?
fatal error: all goroutines are asleep - deadlock!
The text was updated successfully, but these errors were encountered: