diegosouzapw/OmniRoute · error · Error
Invalid cookie JSON at index ${i}: missing required field 'n
Error message
Invalid cookie JSON at index ${i}: missing required field 'name' What it means
Error "Invalid cookie JSON at index ${i}: missing required field 'name'" thrown in diegosouzapw/OmniRoute.
Source
Thrown at src/lib/providers/webCookieAuth.ts:51
try {
parsed = JSON.parse(trimmed);
} catch {
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;View on GitHub (pinned to a179ffed5b)
When it happens
Trigger: Thrown at src/lib/providers/webCookieAuth.ts:51 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/9810373220fbfb92.
Report an issue: GitHub.