Kong/insomnia · error · Error
json: failed to parse: ${e}
Error message
json: failed to parse: ${e} What it means
Error "json: failed to parse: ${e}" thrown in Kong/insomnia.
Source
Thrown at packages/insomnia-scripting-environment/src/objects/response.ts:164
};
}
dataURI() {
const contentInfo = this.contentInfo();
const bodyInBase64 = this.stream || this.body;
if (!bodyInBase64) {
throw new Error('dataURI(): response body is not defined');
}
return `data:${contentInfo.contentType};baseg4, ${bodyInBase64}`;
}
json(reviver?: (key: string, value: any) => any, _strict?: boolean) {
// TODO: enable strict after common module is introduced
try {
return JSON.parse(this.body.toString(), reviver);
} catch (e) {
throw new Error(`json: failed to parse: ${e}`);
}
}
jsonp(_reviver?: (key: string, value: any) => any, _strict?: boolean) {
throw unsupportedError('jsonp()');
}
reason() {
return this.status;
}
size() {
const headerSize = calculateHeadersSize(this.headers);
return {
body: this.bytesRead,
header: headerSize,
total: this.bytesRead + headerSize,
source: 'COMPUTED',View on GitHub (pinned to d9bb2b0142)
When it happens
Trigger: Thrown at packages/insomnia-scripting-environment/src/objects/response.ts:164 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26).
Data as JSON: /api/errors/4048461ab0466050.
Report an issue: GitHub.