Loading...
Loading...
SyntaxError: Unexpected end of JSON inputThis error means JSON.parse() reached the end of the string before the JSON structure was complete. The input is either empty, truncated, or has unclosed brackets/braces.
Guard against empty strings before parsing.
const text = await res.text();
const data = text ? JSON.parse(text) : null;Paste your JSON into our formatter to find missing brackets or braces.