{"record":{"id":"e3eba44a78a629df","repo":"vercel/next.js","slug":"cannot-reliably-include-an-imageresponse-option","errorCode":null,"errorMessage":"Cannot reliably include an `ImageResponse` option of type `${typeName}` in the cache key, so different images may collide and return an incorrect cached result. Please report this to the Next.js team.","messagePattern":"Cannot reliably include an `ImageResponse` option of type `(.+?)` in the cache key, so different images may collide and return an incorrect cached result\\. Please report this to the Next\\.js team\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/og/cache-image-response.ts","lineNumber":357,"sourceCode":"    for (const item of value) {\n      updateHashWithOptions(hash, item)\n    }\n    return\n  }\n\n  // The key walk below captures a plain object faithfully, but an exotic object\n  // keeps its state elsewhere (a `Map`'s/`Set`'s entries, a `Date`'s time), so\n  // two different values would hash the same and could return the wrong cached\n  // image. This shouldn't happen for `ImageResponse` options, so we warn rather\n  // than fail, then hash best-effort, so it can be reported. Not gated on\n  // `NODE_ENV`: this runs during the production `next build` prerender, where\n  // the warning is most useful.\n  const prototype = Object.getPrototypeOf(value)\n  if (prototype !== Object.prototype && prototype !== null) {\n    const typeName =\n      (value as { constructor?: { name?: string } }).constructor?.name ??\n      'object'\n    console.warn(\n      `Cannot reliably include an \\`ImageResponse\\` option of type ` +\n        `\\`${typeName}\\` in the cache key, so different images may collide and ` +\n        `return an incorrect cached result. Please report this to the Next.js ` +\n        `team.`\n    )\n  }\n\n  const keys = Object.keys(value).sort()\n  hash.update(`{${keys.length},`)\n  for (const key of keys) {\n    updateHashWithBytes(hash, 'k', Buffer.from(key))\n    updateHashWithOptions(hash, (value as Record<string, unknown>)[key])\n  }\n}\n\n/**\n * Hashes a length-prefixed, tagged byte run: `<tag><byteLength>:<bytes>`. The\n * length prefix keeps the run self-delimiting so it can't blend into adjacent","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/og/cache-image-response.ts#L339-L375","documentation":"Error \"Cannot reliably include an `ImageResponse` option of type `${typeName}` in the cache key, so different images may collide and return an incorrect cached result. Please report this to the Next.js team.\" thrown in vercel/next.js.","triggerScenarios":"Thrown at packages/next/src/server/og/cache-image-response.ts:357 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only JSON-serializable options to ImageResponse, or report the issue to the Next.js team."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}