I'm having a really hard time with errors in WASM....
# webassembly
f
I'm having a really hard time with errors in WASM... Any failure is just a blanket
[object WebAssembly.Exception]
with no pointer to what went wrong. How do you guys debug errors?
2
i
To debug wasm you could try to use debugger. It is not very handy but still can point you into the place and reason what happened.
f
@Igor Yakovlev no debugger for windows yet
Or maybe you mean the browser debugger - I'm not sure if it's better than using prints
Really, the issue is not that I don't know where it crashed, it is just that I call some JS method and it blows up with no feedback
I've actually figured out a sort of hack where you wrap the JS code in your own JS code that try/catches the part that errors and prints the real error
w
Are you using the
-Xwasm-use-new-exception-proposal
compiler flag?
f
@Winson Chiu I've tried both with and without and it sometimes helps and sometimes makes things worse
😫 1
m
I've come here looking for solution and looks like there's none at the moment but at least I found a buddy 🙂
I'll resort to
println()
for the time being
w
If you're using Compose maybe running the JS variant has better error messages? Not sure. And that also assumes it's not Wasm specific. But yeah, logs and manually bisecting have been my solution.
👍 1