Closed vera-wcy closed 2 years ago
Thank you for your report. This seems a bug in this library. Could you give me an input that causes the error?
By the way, I'm not sure it is related to this issue, but you should not mutate the object in an encoder (i.e. delete object[field];
). It may lead to unexpected behaviors. I'll explicitly state the behavior in README.md.
If you'd like to mutate an object to be encoded, you can mutate it just before passing it to encode()
:
export function encodeStatsJson(stats: StatsJson) {
const filteredFields = ['name'];
for (const field of filteredFields) {
delete stats[field];
}
const encoded = encode(stats, { extensionCodec });
return Buffer.from(encoded, encoded.byteOffset, encoded.byteLength);
}
Regarding this issue, I found that upgrading the Node 16 version will not have this error (I used Node v16.16.0). The input about this error is an oversized object that I can't give you, it's about the collection of project webpack stats objects.
I see. Thank you.
That seems odd ... I think this library should work with nodejs v12 because it does not depend on any specific features in the latest nodejs or ECMA-262. I'll personally investigate it with nodejs v12. Closing.
Hi, can you help me with this problem? Use @msgpack/msgpack v2.8.0 encode to report an error, as shown in the figure. The node version used is v12.20.1. how to solve this problem?