I am trying to fetch the image from https://api-assets.clashroyale.com/cards/300/CoZdp5PpsTH858l212lAMeJxVJ0zxv9V-f5xC8Bvj5g.png The code to fetch:
fetch('https://api-assets.clashroyale.com/cards/300/CoZdp5PpsTH858l212lAMeJxVJ0zxv9V-f5xC8Bvj5g.png', )
.then(res => res.blob())
.then(myBlob => URL.createObjectURL(myBlob));
The error:
node:internal/errors:464
ErrorCaptureStackTrace(err);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "obj" argument must be an instance of Blob. Received an instance of Blob
at new NodeError (node:internal/errors:371:5)
at Function.createObjectURL (node:internal/url:960:13)
at C:\Users\lars\OneDrive - CVO-AV\Documenten\GuideBot\src\Commands\clash.js:45:37
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
node version: v16.13.1