You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original comment. Moving here as per @kripken's reply because the root cause is unrelated to that issue thread.
tl;dr: libsodium.js first tries to run a WebAssembly build of libsodium, and using Module.onAbort it detects when this fails and falls back to an asm.js build. This works as expected, but in the case of an asynchronous failure (in this case WebAssembly.instantiate failing, as opposed to e.g. window.WebAssembly not existing), it causes an error message to be logged to the console.
My best guess at the root cause was that after firing onAbort, abort goes on to throw an error.
If changing this is worthwhile, what I would expect to happen is for runtime errors to be handled somewhere whenever onAbort is defined, and/or maybe have a different onError handler that catches all failures and passes along the error object. Alternatively, maybe the problem can be fixed while only touching the code that calls WebAssembly.instantiate.
I might able to investigate in more depth and try to fix the issue myself in a few weeks, but if you don't mind submitting a PR, @ffflorian, I would start by looking at the abort function in src/postamble.js and the call to WebAssembly.instantiate in src/preamble.js.
The text was updated successfully, but these errors were encountered:
Sorry to ruin the party but my PR didn't actually fix this issue, but ended up just being a refactor. I think the cleanest way to solve this is following @buu700's suggestion to add an onError to Module that return before the error is being thrown. See #8688.
Original comment. Moving here as per @kripken's reply because the root cause is unrelated to that issue thread.
tl;dr: libsodium.js first tries to run a WebAssembly build of libsodium, and using
Module.onAbort
it detects when this fails and falls back to an asm.js build. This works as expected, but in the case of an asynchronous failure (in this caseWebAssembly.instantiate
failing, as opposed to e.g.window.WebAssembly
not existing), it causes an error message to be logged to the console.My best guess at the root cause was that after firing
onAbort
,abort
goes on to throw an error.If changing this is worthwhile, what I would expect to happen is for runtime errors to be handled somewhere whenever
onAbort
is defined, and/or maybe have a differentonError
handler that catches all failures and passes along the error object. Alternatively, maybe the problem can be fixed while only touching the code that callsWebAssembly.instantiate
.I might able to investigate in more depth and try to fix the issue myself in a few weeks, but if you don't mind submitting a PR, @ffflorian, I would start by looking at the
abort
function in src/postamble.js and the call toWebAssembly.instantiate
in src/preamble.js.The text was updated successfully, but these errors were encountered: