GithubHelp home page GithubHelp logo

Comments (15)

hwyatt avatar hwyatt commented on June 7, 2024

Also, occasionally getting results like this even when the zipping seems successful

Screenshot 2024-01-06 at 6 58 22 AM

from client-zip.

Touffy avatar Touffy commented on June 7, 2024

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.

Touffy avatar Touffy commented on June 7, 2024

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.

hwyatt avatar hwyatt commented on June 7, 2024

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.

freedomsky11 avatar freedomsky11 commented on June 7, 2024

I have met the same problem recently, and I'm use in nextjs too.

from client-zip.

Touffy avatar Touffy commented on June 7, 2024

Wait… do you get the error on the server-side of nextJS ?
Did you bundle client-zip with the nextJS toolchain ?

from client-zip.

hwyatt avatar hwyatt commented on June 7, 2024

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.

Touffy avatar Touffy commented on June 7, 2024

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.

hwyatt avatar hwyatt commented on June 7, 2024

@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.

hwyatt avatar hwyatt commented on June 7, 2024

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.

davidjunger-oa avatar davidjunger-oa commented on June 7, 2024

The netlify app would help. If I have time to look at it closely enough, anyway.

from client-zip.

Touffy avatar Touffy commented on June 7, 2024

Sorry, forgot to switch back to my main account. The previous message was also me.

from client-zip.

hwyatt avatar hwyatt commented on June 7, 2024

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.

Touffy avatar Touffy commented on June 7, 2024

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.

hwyatt avatar hwyatt commented on June 7, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.