Logs showing empty JSON response from APIs?

Hi all,

Not entirely sure, but our logs are showing issues sometimes from datadog. Think we’ve finally pinpointed the issue.
After a bit of digging. We’ve realised that it could be related to this part of the code

The parse json response needs a message, but it appears the message can be empty. What if response is just a header
with a status code. That means json parse will break with unexpected JSON format. Which it does.

Below are images with the error logs and code snippet from loader package (nextjs)
ref: @plasmicapp/loader-fetcher/dist/loader-fetcher.cjs.development.js

odd that it is receiving just a status code with no body; will take a look. Thanks for digging!

We had it for months now, decided to have a look :smile:
Sure no problem, happy to help

Would be nice to see what the error is as well. Right now we have no idea how to fix it due to lack of insight of the logs.

Redeploying the app makes it run smoothly again and after 1 day it starts consistently producing errors produced by that function. So I am guessing maybe cache related.