Kong/insomnia · error · Error

No headers available

Error message

No headers available

What it means

Template-tag runtime error for {% response 'header' ... %}: the chosen response has an empty headers list, so no header value can be matched against the filter. Indicates a response captured without headers.

Solutions

  1. Ensure the dependency request completed with real headers
  2. Re-send the request to capture headers
  3. Use a different field (body/url) if headers are not needed
Defensive patterns

Strategy: retry

When it happens

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

Appendix: source

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

        const charset = match && match.length >= 2 ? match[1] : 'utf8';
        if (field === 'url') {
          return response.url;
        }
        if (field === 'raw' && bodyBuffer !== null) {
          // 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) {

View on GitHub (pinned to d9bb2b0142)