Kong/insomnia · error · Error

Returned no results

Error message

Returned no results: ${sanitizedFilter}

What it means

Template-tag runtime error for {% response 'body' '$...' %}: the JSONPath query executed successfully but matched zero nodes in the response JSON. The filter that returned nothing is interpolated so it can be adjusted.

Solutions

  1. Validate the XPath against the actual XML response
  2. Check element/attribute names and namespaces in the query
  3. Ensure the response body is the XML you expect
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/insomnia/src/common/templating/local-template-tags.ts:729 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/86f7eaed474f5f3c. Report an issue: GitHub.

Appendix: source

Thrown at packages/insomnia/src/common/templating/local-template-tags.ts:729

              // Using JSONBig instead of JSON.parse because JSON can contain numbers larger than those representable by
              // IEEE 754 and cause them to be rounded or transformed into scientific notation. Interpreting them as
              // strings in the context of this tag allows for predictable piping from response to request.
              bodyJSON = JSONBigStringParser.parse(body) as null | boolean | number | string | object | unknown[];
            } catch (err) {
              throw new Error(`Invalid JSON: ${err.message}`);
            }

            try {
              results = await JSONPath({ json: bodyJSON, path: sanitizedFilter });
              if (!Array.isArray(results)) {
                results = [results];
              }
            } catch {
              throw new Error(`Invalid JSONPath query: ${sanitizedFilter}`);
            }

            if (results.length === 0) {
              throw new Error(`Returned no results: ${sanitizedFilter}`);
            }

            if (results.length > 1) {
              return JSON.stringify(results);
            }

            if (typeof results[0] !== 'string') {
              return JSON.stringify(results[0]);
            }
            return results[0];
          }
          const DOMParser = (await import('@xmldom/xmldom')).DOMParser;
          const document = new DOMParser().parseFromString(body, 'text/xml');
          if (sanitizedFilter === undefined) {
            throw new Error('Must pass an XPath query.');
          }
          try {
            const selectedValues = (await import('xpath')).select(sanitizedFilter, document as unknown as Node); // https://github.com/xmldom/xmldom/issues/724

View on GitHub (pinned to d9bb2b0142)