shauky
// Something happens when getting Json data from STRAPI_API_URL, (formatting perhaps?) piping properly formatted raw data and works.
error: Uncaught (in promise) SyntaxError: Unexpected token N in JSON at position 0
// with error catching
try {
respond data
const response = new Response(body, {
headers: { “content-type”: “text/html; charset=utf-8” },
});
console.log(‘response data?’, data)
event.respondWith(response);
} catch(error) {
console.log(‘Error happened here!’)
console.error(error)
}
SyntaxError: Unexpected token N in JSON at position 0
1 reply