Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion blocks/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ const wrapLoader = (
stats.cache.add(1, { status, loader });
}

return await matched.json();
const json = await matched.text();
try {
return JSON.parse(json);
} catch (error) {
logger.error("MATCHED", {json: json || "no json", loader, url: url.toString()});
throw error;
}
};

return await flights.do(request.url, staleWhileRevalidate);
Expand Down
Loading