Skip to content

Version 3.0.0 always appears an error in the mobile browser: TypeError: Symbol.dispose is not defined. #260

Description

@DeHby

Version 3.0.0 always appears an error in the mobile browser: TypeError: Symbol.dispose is not defined.
demo:
wsClient.onmessage = async function (evt) {
let parseData;
const decompressedData = pako.inflate(await evt.data.arrayBuffer());

Activity

  1. Alextopher commented on Feb 10, 2025

    @Alextopher

    I have the same bug. If I may join this bug report. I just updated from v3.0.0-beta3 to v3.0.0

    I'm seeing this issue on Firefox 135.0 (64-bit) (Linux, Fedora), but not on Chromium Version 132.0.6834.159 (Official Build) (64-bit). Seems like Symbol.dispose isn't supported on Firefox, yet.

    Uncaught (in promise) TypeError: Symbol.dispose is not defined.
        __addDisposableResource2 @msgpack_msgpack.js:872
        decodeAsync Decoder.ts:349
        decodeAsync decodeAsync.ts:17
        ...
    

    Here is the relevant section:

    private enteringGuard(): Disposable {
    this.entered = true;
    return {
    [Symbol.dispose]: () => {
    this.entered = false;
    },
    };
    }

    I wonder if the wrong syntax is being used, in the typescript docs they use

    [Symbol.dispose]() { ... }

    Instead of

    [Symbol.dispose]: () => { ... }

    I am out of time to look at this today, tomorrow I could look deeper.

  2. Alextopher commented on Feb 10, 2025

    @Alextopher

    Falling back to v3.0.0-beta4 is a work-around.

  3. gfx commented on Feb 11, 2025

    @gfx
    Member

    Will fix it, but I reccomend using core-js or something equivalent.

  4. DeHby commented on Feb 11, 2025

    @DeHby
    Author

    Falling back to is a work-around.v3.0.0-beta4

    Yes, I went back to 2.8.0. Since the CDN URL will be redirected to the latest version of MsgPack (3.0.0), I now only dare to put the 2.8.0 min.js directly into my js folder

  5. gfx commented on Feb 11, 2025

    @gfx
    Member

    Released a new version 3.0.1 to fix this issue.

  6. secretwpn commented on Feb 24, 2025

    @secretwpn

    Unfortunately even in 3.0.1 this is still an issue.

    To make matters worse it seems to be browser version sensitive.
    I can not pinpoint the exact adjacent browser versions where it will crash in version A but work fine in version B
    but at least I know that in
    112.0.0.0 and in 118.0.5993.129 it crashes
    but in 130.0.6723.152 and 133.0.0.0 it works fine

    Please, reopen the ticket if possible

  7. akshaykmr commented on Feb 26, 2025

    @akshaykmr

    Just adding another sample. I see this issue in 3.1.0
    Image

    Interestingly not in 3.0.0-beta3.

    Browser: Firefox on mac 135.0.1 (aarch64)

  8. rijenkii commented on Feb 27, 2025

    @rijenkii
    Contributor

    Version 3.0.0-beta4 uses Explicit Resource Management, a feature that not only is not yet supported in popular browsers, but also is not yet even finalized.

    The only correct solution is removing any usage of this feature. See #267.

  9. russellmcc commented on Mar 1, 2025

    @russellmcc

    This is still broken for me on 3.1.0 on Safari 18.3

  10. rijenkii commented on Mar 3, 2025

    @rijenkii
    Contributor

    Fix submitted, waiting for review.

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