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

2.5.0 TypeError: this is not a typed array #47

Closed
chadn opened this issue Nov 20, 2018 · 6 comments
Closed

2.5.0 TypeError: this is not a typed array #47

chadn opened this issue Nov 20, 2018 · 6 comments

Comments

@chadn
Copy link

chadn commented Nov 20, 2018

We use gulp-zip which uses yazl and a few days ago our build broke because of changes in 2.5.0
Here's the error

node_modules/gulp-zip/node_modules/yazl/index.js:111
var eocdrSignatureBuffer = Buffer.from([0x50, 0x4b, 0x05, 0x06]);
                                  ^
TypeError: this is not a typed array.
  at Function.from (na  at Object.<anonymous> (node_modules/gulp-zip/node_modules/yazl/index.js:111:35)

I forked gulp-zip and hardcoded yazl to use version 2.4.3 till this is fixed. Hopefully will be fixed soon.

@deepakpadukone20
Copy link

for node < v4 we need to have something like below instead of directly using Buffer.from

function bufferFrom(content) {
  try {
    return Buffer.from(content);
  } catch(e) {
    if (Object.prototype.toString.call(content) !== '[object String]') {
      throw new TypeError("separator must be a string");
    }
    return new Buffer(content);
  }
}

@Kanwar007-zz
Copy link

I am also getting this error. Could you please tell me when we get the resolve version.

@thejoshwolfe
Copy link
Owner

Thanks for the reports! Will definitely fix this issue. (Thanks @deepakpadukone20 for #48 ) This is a holiday week in the US, so I might not have time to do this right away.

@chetankh23
Copy link

When can we expect the fix for this to be released ?

@thejoshwolfe
Copy link
Owner

I've just gotten travis set up to test yazl against old versions of node. I should be able to fix this tonight.

@thejoshwolfe
Copy link
Owner

yazl version 2.5.1 is now published. This should resolve all the compatibility issues.

Thank you all for your patience!

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

5 participants