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

TypeError: zip.BlobReader is not a constructor when unzipping #340

Closed
devtonhere opened this issue Jul 7, 2022 · 4 comments
Closed

TypeError: zip.BlobReader is not a constructor when unzipping #340

devtonhere opened this issue Jul 7, 2022 · 4 comments

Comments

@devtonhere
Copy link

  1. I've downloaded the zip for this repository from GitHub via the UI.
  2. opened https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.html
  3. choosen the downloaded zip and get the error as a JavaScript prompt:
TypeError: zip.BlobReader is not a constructor 

No errors in the browser console during the unzip attempt, but there are these errors when the page loads:

Uncaught TypeError: class heritage _ is not an object or null
    <anonymous> https://gildas-lormeau.github.io/zip.js/demos/lib/zip.min.js:1
    <anonymous> https://gildas-lormeau.github.io/zip.js/demos/lib/zip.min.js:1
    <anonymous> https://gildas-lormeau.github.io/zip.js/demos/lib/zip.min.js:1
[zip.min.js:1:2361](https://gildas-lormeau.github.io/zip.js/demos/lib/zip.min.js)
Uncaught TypeError: zip.configure is not a function
    selectInflateImplementation https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.js:87
    <anonymous> https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.js:41
    <anonymous> https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.js:164
    <anonymous> https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.js:166
[demo-read-file.js:87:8](https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.js)
    selectInflateImplementation https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.js:87
    <anonymous> https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.js:41
    <anonymous> https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.js:164
    <anonymous> https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.js:166
@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jul 7, 2022

This is because your browser does not support the TransformStream API. You can use the 2.4.x version to fix this here: https://github.com/gildas-lormeau/zip.js/releases/tag/v2.4.26.

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jul 7, 2022

Alternatively, including https://unpkg.com/web-streams-polyfill/dist/polyfill.min.js in your page should fix the issue.

@devtonhere
Copy link
Author

Thanks, updating my firefox did help as well ;)

https://caniuse.com/mdn-api_transformstream

@gildas-lormeau
Copy link
Owner

For the record, I added the polyfill in the demos.

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