Skip to content

TypeError: Failed to fetch // Question #80

@hwyatt

Description

@hwyatt

Hello! I am using client-zip to package up audio tracks (probably ~75-100 at a time) in my NextJS app. The first few times I ran this, it was excitingly performant considering my input. However, after those initial test attempts I am now getting TypeError: Failed to fetch. Is there a better way to handle this based on my use case? I just copy pasta'd the example usage code so I very well could be missing something that would help me out here.

Thank you!

const createZip = async (tracks) => {
  console.log("started");
  let files: any = [];
  tracks.map((track) => {
    track.clips.forEach((clip) => {
      files.push({ name: `${track.name}/${clip.name}`, input: clip.content });
    });
  });
  try {
    // get the ZIP stream in a Blob
    const blob = await downloadZip(files).blob();

    // make and click a temporary link to download the Blob
    const link = document.createElement("a");
    link.href = URL.createObjectURL(blob);
    link.download = "MultiTracks.zip";
    link.click();
    link.remove();
    console.log("finished");
  } catch (err) {
    console.log(err);
  }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions