I am using fetch() to grab data from api server. My error looks like this:
Uncaught (in promise) SyntaxError: Unexpected end of input at fetch.then.blob.
Lots of good responses but I chose this:
const response = await fetch(url, { method: 'GET', headers: { Authorization: 'Bearer ' + accessToken } }); const string = await response.text(); const json = string === "" ? {} : JSON.parse(string); return json;