Comments (15)
Also, occasionally getting results like this even when the zipping seems successful
from client-zip.
TypeError: Failed to fetch
cannot be thrown by client-zip. Can't guess where it comes from without seeing more code.
Don't forget to call URL.revokeObjectURL(link.href)
if you're sure the same download won't be needed after the click. If you do not, the Blob will never be garbage-collected while you remain on the page.
The error shown in your Archive Utility dialog might be caused by your filename logic. client-zip does not sanitize filenames beyond removing or adding a trailing slash (depending on whether the entry is a folder with no content). If you tell client-zip to store a file with an impossible filename — such as an empty string, or just a slash —, it will do that, but it's not terribly surprising that macOS later refuses to extract to that filename.
from client-zip.
Correction : TypeError: Failed to fetch
cannot be thrown by the current version of client-zip. Until 1.6.0 or 2.4.0, there was a fetch
to get the WebAssembly module for CRC32, and it may very well fail, for a number of reasons. Make sure you are using the latest version.
from client-zip.
Thanks for the quick response!
The catch (err) was logging the TypeError: Failed to fetch
, so I just assumed that was the fault of await downloadZip(files).blob();
or my input. I should be on the latest version, but I will double check.
The file naming logic I am using is working at times. It may just be the machine I am using at the moment. I'm gonna do some testing to ensure it's not happening across different machines.
from client-zip.
I have met the same problem recently, and I'm use in nextjs too.
from client-zip.
Wait… do you get the error on the server-side of nextJS ?
Did you bundle client-zip with the nextJS toolchain ?
from client-zip.
I am not using client-zip
in a NextJS API route, but rather in a component. It seemed that after explicitly putting "use client"
at the top of my component that the error had ceased, but I'm still getting it sadly. I am on ^2.4.4
from client-zip.
Could still be the bundling ; there was a bug report a while ago, where nextJS was trying to transpile client-zip to es2016 or something… not ≥ es2020 anyway. But the symptoms were quite different.
I can't help much without access to a page where you have included client-zip with nextJS. Like I said, that error message doesn't exist in client-zip's code — and it has no dependencies that might throw the error — nor any call to fetch
. So it has to come from something added by nextJS, or maybe your own code when you get the input Responses.
from client-zip.
@Touffy I can drop you the Netlify or the repo, if either of those would be helpful. I cannot see currently where Next is attempting to transpile client-zip, but maybe I am missing something obvious.
from client-zip.
I also tried adding client-zip
in my next.config.js
like so:
const nextConfig = {
transpilePackages: ["client-zip"],
};
module.exports = nextConfig;
This also made no difference
from client-zip.
The netlify app would help. If I have time to look at it closely enough, anyway.
from client-zip.
Sorry, forgot to switch back to my main account. The previous message was also me.
from client-zip.
https://sunday-set-builder.netlify.app/
Let me know if I need to setup a way for you to manually trigger the downloadZip()
.
from client-zip.
I haven't triggered a download (a set of valid files would help, I guess) but I can already tell you that client-zip is indeed bundled (into _next/static/chunks/208-0156ce2acf62063b.js) and that it's not transpiled (which is good).
from client-zip.
I was able to reproduce the error by dropping this Test Song 1 into the drop area 4/5 times, then hitting Build Ableton Set. I am logging the error to the console as well.
Link to Zip (just unzip and drop it in the droparea 5 or so times)
https://drive.google.com/file/d/1nSNB5Ca-NWjG-luhltSk4McKWXw4ZpBH/view?usp=drive_link
from client-zip.
Related Issues (20)
- [BUG] downloadZip is not a function when running the build script HOT 10
- [FEATURE] Version without WebAssembly HOT 7
- [BUG] downloadZip creating corrupted zips in demo HOT 2
- [BUG] Non-ASCII characters in file names come out as garbage in Windows Explorer HOT 3
- [BUG] testing with string input leads to uncompressed zip files HOT 4
- [FEATURE] Support parallel downloading HOT 10
- [FEATURE] Propagate cancellation HOT 6
- [BUG] Microsoft Office can not read generated ZIP containing ODS HOT 2
- [QUESTION] Lazyfetch array with objects instead of urls HOT 1
- generated xlsx file but office show error when open it HOT 2
- [QUESTION] How to handle Download cancellations with Service Worker HOT 1
- [FEATURE] Generate ranged responses with `downloadZip` HOT 6
- [BUG] You may need an appropriate loader to handle this file type HOT 5
- [HelpWanted] Download progress HOT 17
- [BUG] Blob is not defined error in SvelteKit project HOT 2
- [QUESTION] How to stream zip without first loading all of it in memory
- [Help Wanted] The zip downloaded using ServiceWorker is empty HOT 4
- Firefox closes service worker (how to know if a zip stream is still ongoing?) HOT 2
- [BUG] Zipped file is empty HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client-zip.