Skip to content

Fix loading Blob in Node environment #903

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

UlyssesZh
Copy link

I fixed #899. The major problem is due to lack of FileReader in Node.

I also cleaned the logic of converting a blob into an array buffer. Note the fact: FileReader.prototype.readAsArrayBuffer and Blob.prototype.arrayBuffer essentially does the same thing, but the former uses callback while the latter uses promise. Also, because File inherits Blob, we do not need to specially take care of File.

npm run test seems fine. Tests all pass.

@FatihBekdemir
Copy link

Hello, I encountered the same problem and saw that you also experienced the same problem loading a blob in a Node environment. What is the status of this PR? I didn't see any conversation about the fix. Will it be merged soon into the main branch?

image

@UlyssesZh
Copy link
Author

You can use "jszip": "github:UlyssesZh/jszip#fix-node-blob" in package.json to use my fork.

@UlyssesZh
Copy link
Author

@jonkoops Hi I see that you started picking up the project. I'm happy to see that this project is now back on track. Could you please review this PR? I believe this may help with some CI problems.

@jonkoops
Copy link
Collaborator

jonkoops commented May 8, 2025

Yes, working on getting things back in shape. I will certainly try and find some time to look at this. Currently, I am knee-deep in wedding planning and my day job, but I will have a massive amount of PTO coming up that I intend to use to put some time into this.

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

Successfully merging this pull request may close these issues.

Reading blob on NodeJs fails
5 participants