{"record":{"id":"d48096c62ab3efa2","repo":"diegosouzapw/OmniRoute","slug":"invalid-cookie-json-at-index-i-expected-an-obj","errorCode":null,"errorMessage":"Invalid cookie JSON at index ${i}: expected an object","messagePattern":"Invalid cookie JSON at index (.+?): expected an object","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/providers/webCookieAuth.ts","lineNumber":46,"sourceCode":"export function parseJsonCookiesToHeader(rawValue: string): string | null {\n  const trimmed = (rawValue || \"\").trim();\n  if (!trimmed || !trimmed.startsWith(\"[\")) return null;\n\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(trimmed);\n  } catch {\n    return null;\n  }\n\n  if (!Array.isArray(parsed)) return null;\n  if (parsed.length === 0) return \"\";\n\n  const parts: string[] = [];\n  for (let i = 0; i < parsed.length; i++) {\n    const entry = parsed[i];\n    if (!entry || typeof entry !== \"object\" || Array.isArray(entry)) {\n      throw new Error(`Invalid cookie JSON at index ${i}: expected an object`);\n    }\n    const record = entry as Record<string, unknown>;\n\n    if (typeof record.name !== \"string\" || !record.name) {\n      throw new Error(`Invalid cookie JSON at index ${i}: missing required field 'name'`);\n    }\n    if (typeof record.value !== \"string\") {\n      throw new Error(`Invalid cookie JSON at index ${i}: missing required field 'value'`);\n    }\n\n    parts.push(`${record.name}=${record.value}`);\n  }\n\n  return parts.join(\"; \");\n}\n\nexport function normalizeSessionCookieHeader(rawValue: string, defaultCookieName: string): string {\n  const stripped = stripCookieInputPrefix(rawValue);","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/providers/webCookieAuth.ts#L28-L64","documentation":"Error \"Invalid cookie JSON at index ${i}: expected an object\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/providers/webCookieAuth.ts:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}