Repository navigation
Version 3.0.0 always appears an error in the mobile browser: TypeError: Symbol.dispose is not defined. #260
Description
Activity
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 onChromium Version 132.0.6834.159 (Official Build) (64-bit). Seems likeSymbol.disposeisn'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:
msgpack-javascript/src/Decoder.ts
Lines 295 to 302 in 130ea87
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.
Falling back to
v3.0.0-beta4is a work-around.Will fix it, but I reccomend using core-js or something equivalent.
Reacted by DeHby and Christopher MahoneyReacted by rijenkiiFalling back to is a work-around.
v3.0.0-beta4Yes, 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
Released a new version 3.0.1 to fix this issue.
Reacted by DeHby, Josh Kelley and Christopher Mahoney- added a commit that references this issue
on Feb 21, 2025 Unfortunately even in
3.0.1this 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.0and in118.0.5993.129it crashes
but in130.0.6723.152and133.0.0.0it works finePlease, reopen the ticket if possible
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.
Reacted by Simon and Russell McClellanThis is still broken for me on 3.1.0 on Safari 18.3
Fix submitted, waiting for review.
Reacted by Akshay Kumar

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());