Похожие чаты

Has anyone ever used JSZip? I’m doing this: const

F = [
{
name: 'laptop',
url: 'https://res.cloudinary.com/dbxcernxw/image/upload/v1674379837/Mridul.Tech%20Blog/pexels-laptop_tfnlrg.jpg',
type: 'jpeg',
},
{
name: 'coding-react-js',
url: 'https://res.cloudinary.com/dbxcernxw/image/upload/v1674379837/Mridul.Tech%20Blog/pexels-react-code_gkeio5.jpg',
type: 'jpeg',
},
{
name: 'coding-python',
url: 'https://res.cloudinary.com/dbxcernxw/image/upload/v1674379837/Mridul.Tech%20Blog/pexels-python-code_qau1ba.jpg',
type: 'jpeg',
},
{
name: 'coding-pdf',
url: 'https://zip-download-next-js.vercel.app/assets/photos-pdf.pdf',
type: 'pdf',
},
];

const remoteZips = F.map(async (file) => {
const response = await fetch(file.url);
const data = await response.blob();

zip.file(`${file.name}.${file.type}`, data);

return data;
});


But I’m getting this error:


⨯ node_modules/jszip/lib/utils.js (479:16) @ eval
⨯ unhandledRejection: Error: Can't read the data of 'coding-react-js.jpeg'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?
at eval (webpack-internal:///(rsc)/./node_modules/jszip/lib/utils.js:417:44)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
null

2 ответов

7 просмотров

Wall of text. Please read @rulesforthedevs and use one of the suggested pastebins

try response.arrayBuffer() ?

Похожие вопросы

Обсуждают сегодня

Hi everyone! I have a two-folded message to share today. First: updates and news, as we are being asked for those. We still want to go like we did the last 6 years: we w...
Marten | Unibright.io
31
Oh.... Admins at the main TG is already muted me. How many months Sir you muted me? Or forever if you are here @Janevietani @JohnnySonic
Charles Dar
28
Скажите, можно ли как-то "переместить" динамический массив из одной переменной в другую? Скажем, переместить из TList<> в TArray<>. Именно переместить, а не скопировать. Если ...
Eugene Krasnikov (ᴊɪɴ x)
37
комрады, че-та лыжы не едут var tmpFont: TFont; begin tmpFont:= TFont.Create; try case rgFontColor.ItemIndex of 0: tmpFont.Color:= clWindowText; 1: tmpFo...
Ed Doc
34
.model small .stack 100h .data a db 'Hello, World!', '$' ; исходная строка b db 20 dup(?) ; строка b с запасом на максимальную длину .code main: ...
Алексей -man
3
вопрос, кого посмотреть в ютубе или где почитать про указатели чтобы раз и навсегда запомнить зачем они нужны и как правильно ими пользоваться? поделитесь хорошими ресурсами, ...
-
14
М-да. Почему бы просто со stringlist не работать?
Michael Longneck
23
Интересно, нет ли какого-то способа получить из dll не адрес самой метки, а адрес со смещением?
The Bird of Hermes
54
Редактор листа Excel, по сути двумерный массив ячеек. Ячейка - это экземпляр класса, у нее всякие свойства, методы. Проблема в том, что количество используемых строк и колоно...
Sergey Bodrov
2
in one table i have two columns one is unique and another is duplicate. unique always unique and duplicate is that maybe has duplicate and may be not. now i want get Duplicat...
Mr Thieves
2
Карта сайта