foliojs / brotli.js

A JavaScript port of the Brotli compression algorithm, as used in WOFF2
500 stars 51 forks source link

Output buffer is not large enough #15

Closed GabCamarda closed 7 years ago

GabCamarda commented 7 years ago

I'm getting this error Output buffer is not large enough and I can't figure out why. The code is

const br = require('brotli');

let decodedData = br.decompress(content);
const buf = new Buffer(decodedData);

callback(buf.toString('utf-8'));
return;

This doesn't always happen. After a few retry with the same content it works. Any ideas why this is happening?

Thank you

GabCamarda commented 7 years ago

This seemed to be related to an old version. I had 1.2.0 and I now updated it to 1.3.1 and the error has gone.