-
Notifications
You must be signed in to change notification settings - Fork 46
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
Uncaught ReferenceError error(s) when WebAssembly is not available #147
Comments
I might be interested in trying to resolve this if someone would be able to point me in the right direction for the source code that compiles into these checks. |
@localpcguy Sorry for not getting back here! The file you referenced The code you are referencing comes from emscripten itself and compiles in JS binding code that loads in our web assembly. In that link, you'll see the FAQ they provide around this. I do find it kind of strange that at that level it is calling WebAssembly to throw a runtime error. You can find that error here: https://github.com/emscripten-core/emscripten/blob/main/src/preamble.js#L505 We might be able to add the check at the high-level JS before loading it in potentially (in our |
Thanks, I'll try to take a look and see if 1) it's still an issue with the the newer JS files (I've been using this through |
Hi @localpcguy - do you still have this issue today? |
I can try to test it later on, in our app, we use a wrapper component / widget that tests for WASM support prior to trying to instantiate Rive, and if it doesn't exist, doesn't load Rive (and provides a fallback). So I'll need to disable that check and see if it still errors then. I do still see that same code lines in my original post above. I have not had a chance to investigate whether ng-rive needs updates. |
I was able to check and verify that I am still seeing this error. However, I'm guessing it is as you noted, that it might be using an older version of your code. The ng-rive package (for using Rive in Angular apps via an Angular component) is using |
Just wanted to update this, still seeing the same error, now using a more up to date version of rive-canvas ( I took a look into the Emscripten code in the preamble where this error gets thrown, and it seems to be intentional as per this comment recommended adding that change and the PR implementing it. At that time, it was still wrapped in an if block that looked for WASM, however, the removal of fastcomp meant that would always be true, so a subsequent PR removed the check altogether. That's where I left off. My understanding is that throwing a For this issue, I'll likely just continue to check for WebAssembly support before trying to instantiate a Rive animation or use any of the Rive WASM functionality. At this point, up to y'all if you want to keep this issue open or not. |
Closing - the fix in Emscripten was to remove the WebAssembly check from release builds altogether and only check for WebAssembly in debug builds. Closing this issue as it is intentional that the generated code throw the error that |
Despite checks for WebAssembly support, the
abort
method then tries to use WebAssembly to create a RuntimeError and crashes with an Uncaught ReferenceError. This is in an Angular app using ng-rive, but the errors appears to be in the code here.Expected: if lack of WebAssembly support can cause
abort
to be called, it should recheck its availability before using it internally.(note: sorry, the samples are from the rive.mjs file I see in my browser and published versions here as I couldn't find where they were compiled from in a quick search in this repo without a deeper dive)
The check to see if WebAssembly exists:
rive-wasm/wasm/publish/rive.lean.mjs
Lines 215 to 217 in 9a57351
however, the abort function tries to use WebAssembly:
rive-wasm/wasm/publish/rive.js
Lines 555 to 567 in 9a57351
Specifically:
rive-wasm/wasm/publish/rive.js
Line 564 in 9a57351
Error in console:
The text was updated successfully, but these errors were encountered: