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

this code fails in the browser but works in node #6

Open
andrewrk opened this issue Aug 8, 2013 · 1 comment
Open

this code fails in the browser but works in node #6

andrewrk opened this issue Aug 8, 2013 · 1 comment

Comments

@andrewrk
Copy link
Contributor

andrewrk commented Aug 8, 2013

var text = "H4sIAAAAAAAAA+3czU7CUBSF0TIA48DEgQ58/xdVIiQE7ukPXHoOsFbyjTRQaHcUJA4DAAAAAAAAAAAAAAAAAABc2h4CLtkHxOwDYvYBMfuAmH1AzD4gZh8Qsw+I2QfE7ANi9gEx+4CYfUDMPiBmHxCzD4jZB8TsA2L2ATH7gJh9QMw+IGYfELMPiNkHxOwDYvYBMfuAmH3w6j5POmcfVPSz0v3sN/Fx0vlG7IMKNn+9jXSLsdudyj7Itt/GdqJbfDeaur+e9w/XmrONe1yfX8OyzZDj+HvFe/aBJJi7jbWuz7HN0N/U787n10fVjcx9rbzkNfWSbWRen8fNPJtbXpP16nhup76+nfG9c16nZj/ea56b6vt4Vkuf/0fpFR+zffSXfT7twz4qyz6f92o3Uvax2cfjyD6fso/Kss+n+jb2c3M39LHpdDunrvmczBqfrck+n+rbWu+ptWS/11fh/UNpX0v2MUlVask+JqlKLdnHJFWpJfuYpCq1ZB+TVKVX+7urJEmSJEmSVLHW/3SR9B8AAAAAAAAAAAAAAAAAAAAAAAAANfwCLfpEO4A4AQA=";
var zipped = new Buffer(text, 'base64');
var zlib = require('zlib');
zlib.gunzip(zipped, function(err, buf) {
  if (err) {
    throw err;
  } else {
    console.log(buf.length);
  }
});

Compile that with browserify and the console says "invalid file signature: "

I wrote a test for zlib-browserify and it passed. So it must be something that breaks in the browser but works in node. Is there a way to get a debug build so that we can troubleshoot the issue?

@andrewrk
Copy link
Contributor Author

andrewrk commented Aug 8, 2013

Interesting fact: if I use a bops instance instead of a Buffer, it 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

1 participant