node:zlib: zstd ignores an ArrayBuffer dictionary and does not reject a dictionary of a wrong type (Node v26.10.0 does) · Issue #44258 · oven-sh/bun · GitHub
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
{{ message }}
Repository navigation
node:zlib: zstd ignores an ArrayBuffer dictionary and does not reject a dictionary of a wrong type (Node v26.10.0 does) #44258
The zstd classes of node:zlib ignore a dictionary option that is not a Buffer, TypedArray or DataView. Node v26.10.0 uses an ArrayBuffer dictionary and throws ERR_INVALID_ARG_TYPE for each other type.
bun matches Node v26.3.0 here. Node changed two times after that:
v26.7.0 accepts an ArrayBuffer (nodejs/node#64599, "zlib: accept ArrayBuffer dictionary in Zstd").
v26.10.0 throws for the other types (commit 5e55085bc1, "zlib: reject invalid zstd dictionaries", from nodejs/node#65867).
Reproduction
constzlib=require("node:zlib");constdictionary=Buffer.from("Lorem ipsum dolor sit amet, consectetur adipiscing elit. "+"Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",);constinput=Buffer.alloc(2000,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. ");console.log("view dictionary:",zlib.zstdCompressSync(input,{ dictionary }).length,"bytes");console.log("no dictionary:",zlib.zstdCompressSync(input).length,"bytes");constarrayBuffer=dictionary.buffer.slice(dictionary.byteOffset,dictionary.byteOffset+dictionary.byteLength);for(const[label,value]of[["ArrayBuffer",arrayBuffer],["string","a string"],["number",42],["null",null],]){try{conststream=zlib.createZstdCompress({dictionary: value});console.log(label+":",stream._processChunk(input,zlib.constants.ZSTD_e_end).length,"bytes");}catch(e){console.log(label+": throws",e.code);}}
Activity
Jarred-Sumner commentedon Oct 8, 2026
Use handoff tool. GitHub issues are for user-facing issues and a user did not run into this issue