Closed nickmaddren closed 1 year ago
Hey 👋 thanks for providing such a useful library.
I have a question about an error that occurs when I abort the zip writer:
const handleZip = async (files: FileWithPath[], abortController) => { const blobWriter = new BlobWriter('application/zip'); const zipWriter = new ZipWriter(blobWriter, { bufferedWrite: true, signal: abortController.signal }); // write the zip await Promise.all( files.map(file => { return zipWriter.add(file.path, new BlobReader(file), { lastModDate: new Date(file.lastModified), }); }) ); await zipWriter.close(null); // get blob and return new zip file const blob = await blobWriter.getData(); return new File([blob], 'files.zip', { type: 'application/zip' }); };
If I pass multiple files and then use abortController.abort() I see this error:
abortController.abort()
1 Uncaught (in promise) TypeError: Failed to fetch
There is no stack trace.
If I remove bufferedWrite: true this error does not occur.
bufferedWrite: true
I'm using the latest version of the library.
Any idea why this error occurs and how I stop it from throwing?
Thank you, the bug should be fixed in the version 2.6.37 I just published.
Thank you so much!
You're welcome :)
Wow thanks so much @gildas-lormeau !
Hey 👋 thanks for providing such a useful library.
I have a question about an error that occurs when I abort the zip writer:
If I pass multiple files and then use
abortController.abort()
I see this error:There is no stack trace.
If I remove
bufferedWrite: true
this error does not occur.I'm using the latest version of the library.
Any idea why this error occurs and how I stop it from throwing?