Kong/insomnia · error · Error

jsonp() is not supported yet

Error message

jsonp() is not supported yet

What it means

Deliberate unsupported-API error on the scripted Response object: jsonp() (Postman SDK parity) is not implemented in Insomnia's scripting environment, so any script calling response.jsonp() always throws.

Solutions

  1. Parse the body manually instead: const body = JSON.parse(pm.response.text()) and strip the JSONP wrapper
  2. Use response.json() when the response body is plain JSON
  3. Avoid Postman-only Response APIs in Insomnia scripts
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/insomnia-scripting-environment/src/objects/response.ts:169 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/9922926f70d5dd95. Report an issue: GitHub.

Appendix: source

Thrown at packages/insomnia-scripting-environment/src/objects/response.ts:169

    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',
    };
  }

  text() {
    return this.body.toString();

View on GitHub (pinned to d9bb2b0142)