question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calling `inflate` on data created from `Pako.deflate` returns `(null, null)`

See original GitHub issue

Some observations that I noted:

inflate fails with (null, null)

image

inflateSync fails with EOF:

image

This is probably the most important problem since one would expect either data or an error.

decompress works fine:

image

deflateSync : incorrect header check

It appears as though Pako has a different idea of what constitutes inflate / deflate i.e.

image

gzipSync: seems to correspond to pako.inflate

image

I noted that the builtin CompressionStream seems to correlate with what Pako does i.e. 'inflate' algorithm for Pako and CompressionStream seem to be the same.

zlib: same as gzip

image

zip: fails, same as deflate

image

Summary

I’ve no idea what’s going on here (and the issues observed may be with Pako), but I hope the above is useful feedback.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
101arrowzcommented, May 23, 2021

v0.7.0 is released and this bug should be fixed, along with the improved errors from #54.

1reaction
101arrowzcommented, May 12, 2021

I found and fixed the bug; will be out in v0.7.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Restore deflate { to: 'string' } option on version 2 #206
Hello, I'm currently using the following code with Pako 1.0.11: pako.deflate(textEncode(source), { level: 9, to: 'string' }) I noticed that the option {...
Read more >
How do you open zlib compressed data from Node.js in ...
I am using the Pako NPM package like so: pako.deflate(JSON.stringify(json), { to: 'string' }) to compress a JSON payload and am able to...
Read more >
pako 2.1.0 API documentation
Sends input data to deflate pipe, generating Deflate#onData calls with new compressed chunks. Returns true on success. The last data block must ...
Read more >
How to use the pako.Deflate function in pako
To help you get started, we've selected a few pako.Deflate examples, based on popular ways it is used in public projects.
Read more >
Worker.js - Source code
// inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. // Here we set flag to process this error properly. // ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found