Kong/insomnia · error · Error

netrc auth is not supported in scripting yet

Error message

netrc auth is not supported in scripting yet

What it means

Not-implemented guard in toPreRequestAuth (the reverse conversion, script auth model to pre-request options): the auth type is 'netrc', which cannot yet be serialized for the pre-request scripting runtime. Any script producing netrc auth hits this TODO path.

Solutions

  1. Avoid netrc when scripts mutate the request
  2. Use basic or bearer auth instead
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:806 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/e4eb204171521b2b. Report an issue: GitHub.

Appendix: source

Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:806

      };
    }
    case 'asap': {
      return {
        type: 'asap',
        asap: [
          { key: 'disabled', value: auth.disabled ? 'true' : 'false' },
          { key: 'iss', value: auth.issuer || '' },
          { key: 'sub', value: auth.subject || '' },
          { key: 'aud', value: auth.audience || '' },
          { key: 'claims', value: auth.additionalClaims || '' },
          { key: 'kid', value: auth.keyId || '' },
          { key: 'privateKey', value: auth.privateKey || '' },
        ],
      };
    }
    case 'netrc': {
      // TODO: not supported yet
      throw new Error('netrc auth is not supported in scripting yet');
    }
    case 'singleToken': {
      // TODO: not supported yet
      throw new Error('singleToken auth is not supported in scripting yet');
    }
    default: {
      // @ts-expect-error - user can input any string
      throw new Error(`unknown auth type: ${auth.type}`);
    }
  }
}

View on GitHub (pinned to d9bb2b0142)