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
Description:
An error is thrown when trying to decode an ArrayBuffer
/home/luigi/pack/node_modules/msgpack-lite/lib/read-core.js:15
if (!func) throw new Error("Invalid type: " + (type ? ("0x" + type.toString(16)) : type));
^
Error: Invalid type: undefined
at Codec.decode (/home/luigi/pack/node_modules/msgpack-lite/lib/read-core.js:15:22)
at DecodeBuffer.fetch (/home/luigi/pack/node_modules/msgpack-lite/lib/decode-buffer.js:54:21)
at DecodeBuffer.read (/home/luigi/pack/node_modules/msgpack-lite/lib/decode-buffer.js:39:28)
at Object.decode (/home/luigi/pack/node_modules/msgpack-lite/lib/decode.js:10:18)
at Object.<anonymous> (/home/luigi/pack/index.js:10:9)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
Test case:
'use strict';constmsgpack=require('msgpack-lite');constarr=newUint8Array([163,102,111,111]);msgpack.decode(arr);// Works as intendedmsgpack.decode(arr.buffer);// Throws
Is this expected? Should an ArrayBuffer be explicitly converted to a typed array before decoding it?
I stumbled upon this when trying to decode a message from a WebSocket object whose binaryType was set to arraybuffer.
The text was updated successfully, but these errors were encountered:
Version: 0.1.20
Description:
An error is thrown when trying to decode an
ArrayBuffer
Test case:
Is this expected? Should an
ArrayBuffer
be explicitly converted to a typed array before decoding it?I stumbled upon this when trying to decode a message from a
WebSocket
object whosebinaryType
was set toarraybuffer
.The text was updated successfully, but these errors were encountered: