Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node zlib inflateSync will take UInt8Array, browserify-zlib won't #42

Open
johnwhitington opened this issue Aug 12, 2022 · 1 comment
Open

Comments

@johnwhitington
Copy link

For example, this code is fine with node:

zlib.inflateSync(arr);

But with browserify-zlib we get TypeError: not a string or buffer and we must write instead:

zlib.inflateSync(Buffer.from(arr))
@charlieanstey
Copy link

Getting the same with deflateSync used with a buffer.

import Zlib from "browserify-zlib";

const byteArray = new TextEncoder().encode("foo");

Zlib.deflateSync(byteArray.buffer); // should work, throws TypeError: not a string or buffer

Zlib.deflateSync(Buffer.from(byteArray)); // works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants