Kong/insomnia · error · Error

failed to create cookie, extension must be: { key: string; v

Error message

failed to create cookie, extension must be: { key: string; value: string }[]

What it means

Error "failed to create cookie, extension must be: { key: string; value: string }[]" thrown in Kong/insomnia.

Source

Thrown at packages/insomnia-scripting-environment/src/objects/cookies.ts:103

    }

    // Tough Cookies extensions works well with string[], but not {key: string; value: string}[]
    const extensions = cookieObj.extensions?.map((entry: string | { key: string; value: string }) => {
      if (typeof entry === 'string') {
        const equalPos = entry.indexOf('=');
        if (equalPos > 0) {
          return { key: entry.slice(0, equalPos), value: entry.slice(equalPos + 1) };
        }
        return { key: entry, value: 'true' };
      } else if (
        'key' in entry &&
        'value' in entry &&
        typeof entry.key === 'string' &&
        typeof entry.value === 'string'
      ) {
        return { key: entry.key, value: entry.value };
      }
      throw new Error('failed to create cookie, extension must be: { key: string; value: string }[]');
    });

    return {
      key: cookieObj.key,
      value: cookieObj.value,
      expires: cookieObj.expires || undefined,
      maxAge: cookieObj.maxAge,
      domain: cookieObj.domain || undefined,
      path: cookieObj.path || undefined,
      secure: cookieObj.secure || false,
      httpOnly: cookieObj.httpOnly || false,
      hostOnly,
      session,
      extensions: extensions,
    };
  }

  static stringify(cookie: Cookie) {

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia-scripting-environment/src/objects/cookies.ts:103 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/6c549730ed3fa9ba. Report an issue: GitHub.