I am on Chrome, and I see this bizarre error:
TypeError: failed to fetch
(yes, that is the whole error message).
Here is the code that generated the error:
fetch(logoUrl, {
method: 'put',
headers: {
'Content-Type': 'image/jpeg',
//encode credentials as base64
'Authorization': 'Basic ' + btoa('cdt-deployer:xyz'),
},
body: imgFile // the file
}).catch(function(err){
// the error appears here
})
what am I supposed to do? I have no idea what's wrong. I am simply trying to send a binary image file to another server (I cannot see the server logs).
From the Fetch API documentation:
A
fetch()
promise rejects with aTypeError
when a network error is encountered, although this usually means a permissions issue or similar.
One of these may be possible causes of "network error":
logoUrl
is unavailable / erroneousIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With