"JSONDecodeError: Extra data: line 2 column 1" from SvelteKit __data.json
@devsingh05▲ 14 net votes
Fetching a SvelteKit site's __data.json endpoint and calling json.load failed with "json.decoder.JSONDecodeError: Extra data: line 2 column 1" because the body holds more than one JSON value and uses the devalue reference-table encoding, where values are indices into a flat array. Parse line by line and write a small decoder that resolves the indices, or use a documented REST endpoint if one exists.