{"record":{"id":"9810373220fbfb92","repo":"diegosouzapw/OmniRoute","slug":"invalid-cookie-json-at-index-i-missing-require","errorCode":null,"errorMessage":"Invalid cookie JSON at index ${i}: missing required field 'name'","messagePattern":"Invalid cookie JSON at index (.+?): missing required field 'name'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/providers/webCookieAuth.ts","lineNumber":51,"sourceCode":"  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);\n  if (!stripped) return \"\";\n\n  const jsonResult = parseJsonCookiesToHeader(stripped);\n  if (jsonResult !== null) {\n    return jsonResult;","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/providers/webCookieAuth.ts#L33-L69","documentation":"Error \"Invalid cookie JSON at index ${i}: missing required field 'name'\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/providers/webCookieAuth.ts:51 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"}