Skip to content

Uncaught ReferenceError error in abort (preamble.js) when WebAssembly is not available  #21484

Closed

Description

@localpcguy

The abort method in preamble.js tries to use WebAssembly to create a RuntimeError and crashes with an Uncaught ReferenceError when WebAssembly is not available. Looking at the history, this used to be wrapped in a check for WASM, but once fastcomp was removed, that check would always be true, and so the check was removed.

My question is, is it intentional for it to fail with an Uncaught ReferenceError: WebAssembly is not available or was that a side effect of WASM being true and then being removed? It does seem per the original intent that there should be an error thrown at this point to exit/abort the script, so would any fix just end up throwing a manually crafted error instead of failing due to WebAssembly being undefined?

This error is currently seen when using Rive-Canvas, which using emscripten, if I don't check for WebAssembly support prior to trying to use their code.
image
image

Activity

  1. changed the title [-]Open Uncaught ReferenceError error in abort when WebAssembly is not available [/-] [+]Uncaught ReferenceError error in abort when WebAssembly is not available [/+] on Mar 7, 2024
  2. changed the title [-]Uncaught ReferenceError error in abort when WebAssembly is not available [/-] [+]Uncaught ReferenceError error in abort (preamble.js) when WebAssembly is not available [/+] on Mar 7, 2024
  3. kripken commented on Mar 8, 2024

    @kripken
    Member

    Is this in a debug or release build?

    In a debug build we should make sure we have a clear error for this. If we don't have one we should add one.

    In a release build that targets wasm (i.e. not wasm2js) we do not generally add to the output size in order to get nicer error messages. Running such a build on a VM without the WebAssembly object would be a such a case, I think - not worth adding to size for, in release.

  4. localpcguy commented on Mar 11, 2024

    @localpcguy
    Author

    I believe it is in a release build. I agree it would be nice to have a clear error in a debug build, if nothing else, it would make it clear when reading that code that it is throwing intentionally and is not an error that requires resolution.

  5. added 3 commits that reference this issue on Mar 11, 2024
    fbfa791
    0597d35
    c4aed62
  6. added a commit that references this issue on Mar 13, 2024
    5f9ee69
  7. added a commit that references this issue on Apr 12, 2024
    baa07c9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions