diegosouzapw/OmniRoute · error · Error

Invalid cookie JSON at index ${i}: missing required field 'v

Error message

Invalid cookie JSON at index ${i}: missing required field 'value'

What it means

Error "Invalid cookie JSON at index ${i}: missing required field 'value'" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/providers/webCookieAuth.ts:54

    return null;
  }

  if (!Array.isArray(parsed)) return null;
  if (parsed.length === 0) return "";

  const parts: string[] = [];
  for (let i = 0; i < parsed.length; i++) {
    const entry = parsed[i];
    if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
      throw new Error(`Invalid cookie JSON at index ${i}: expected an object`);
    }
    const record = entry as Record<string, unknown>;

    if (typeof record.name !== "string" || !record.name) {
      throw new Error(`Invalid cookie JSON at index ${i}: missing required field 'name'`);
    }
    if (typeof record.value !== "string") {
      throw new Error(`Invalid cookie JSON at index ${i}: missing required field 'value'`);
    }

    parts.push(`${record.name}=${record.value}`);
  }

  return parts.join("; ");
}

export function normalizeSessionCookieHeader(rawValue: string, defaultCookieName: string): string {
  const stripped = stripCookieInputPrefix(rawValue);
  if (!stripped) return "";

  const jsonResult = parseJsonCookiesToHeader(stripped);
  if (jsonResult !== null) {
    return jsonResult;
  }

  if (stripped.includes("=")) {

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/providers/webCookieAuth.ts:54 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/2d4db4335a74def2. Report an issue: GitHub.