Kong/insomnia · error · Error

No header with name " ". Choices are [ ]

Error message

No header with name "${sanitizedFilter}".
Choices are [
	${names}
]

What it means

Template-tag runtime error for {% response 'header' ... %}: headers exist but none matches the sanitized filter name. The message lists all available header names as choices so the filter can be corrected.

Solutions

  1. Check the header name spelling and case in the tag argument
  2. Log the actual response headers (e.g. via a debug request) and pick an existing name
  3. Use a wildcard or response field like body/status if the header is genuinely absent
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

          // Sometimes iconv conversion fails so fallback to regular buffer
          if (typeof bodyBuffer === 'string') {
            throw new TypeError(bodyBuffer);
          }
          try {
            return context.util.decode(bodyBuffer, charset);
          } catch (err) {
            console.warn('[response] Failed to decode body', err);
            return utf8StringFromBytes(bodyBuffer);
          }
        }
        if (field === 'header') {
          if (!response.headers.length) {
            throw new Error('No headers available');
          }
          const header = response.headers.find(h => h.name.toLowerCase() === sanitizedFilter.toLowerCase());
          if (!header) {
            const names = response.headers.map(c => `"${c.name}"`).join(',\n\t');
            throw new Error(`No header with name "${sanitizedFilter}".\nChoices are [\n\t${names}\n]`);
          }
          return header.value;
        }

        if (field === 'body' && bodyBuffer !== null) {
          // Sometimes iconv conversion fails so fallback to regular buffer
          let body;
          if (typeof bodyBuffer === 'string') {
            throw new TypeError(bodyBuffer);
          }
          try {
            body = await context.util.decode(bodyBuffer, charset);
          } catch (err) {
            console.warn('[response] Failed to decode body', err);
            body = utf8StringFromBytes(bodyBuffer);
          }

          if (sanitizedFilter.indexOf('$') === 0) {

View on GitHub (pinned to d9bb2b0142)