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

jszip.min.js:13 Uncaught (in promise) Error: nodebuffer is not supported by this platform #821

Closed
kuhnflyfish opened this issue Apr 27, 2022 · 3 comments

Comments

@kuhnflyfish
Copy link

This error started after upgrading react-scripts to v5.0.1 which required 'buffer' as a dev dependency
Screen Shot 2022-04-27 at 6 59 10 AM

@Stuk
Copy link
Owner

Stuk commented Apr 27, 2022

Is this running in Node or in the Browser? Is this error occurring in your code or in react-scripts?

The test is for a Buffer global. If this is in your code in the browser you should use an output natively supported in the browser

exports.nodebuffer = typeof Buffer !== "undefined";

@kuhnflyfish
Copy link
Author

The error is being thrown in Chrome's console. It is thrown on every page including most of them where jszip isn't even used. So you are saying Chrome does not support typeof Buffer? Another dev added shpjs to this project which has a dependency on jszip. I'm unsure of anything they did related to jszip directly if anything.

@Stuk
Copy link
Owner

Stuk commented Apr 27, 2022

Buffer is a Node-only API, although some bundlers will polyfill it. As this is using Buffer in the browser I'm going to close this as I don't think it's a bug with JSZip. Let me know if I'm wrong.

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