{"record":{"id":"7fb2985a5399fe74","repo":"facebook/react","slug":"a-cache-instance-was-retained-after-it-was-already","errorCode":null,"errorMessage":"A cache instance was retained after it was already freed. This likely indicates a bug in React.","messagePattern":"A cache instance was retained after it was already freed\\. This likely indicates a bug in React\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/react-reconciler/src/ReactFiberCacheComponent.js","lineNumber":93,"sourceCode":"  CacheContext._currentRenderer = null;\n  CacheContext._currentRenderer2 = null;\n}\n\n// Creates a new empty Cache instance with a ref-count of 0. The caller is responsible\n// for retaining the cache once it is in use (retainCache), and releasing the cache\n// once it is no longer needed (releaseCache).\nexport function createCache(): Cache {\n  return {\n    controller: new AbortControllerLocal(),\n    data: new Map(),\n    refCount: 0,\n  };\n}\n\nexport function retainCache(cache: Cache) {\n  if (__DEV__) {\n    if (cache.controller.signal.aborted) {\n      console.warn(\n        'A cache instance was retained after it was already freed. ' +\n          'This likely indicates a bug in React.',\n      );\n    }\n  }\n  cache.refCount++;\n}\n\n// Cleanup a cache instance, potentially freeing it if there are no more references\nexport function releaseCache(cache: Cache) {\n  cache.refCount--;\n  if (__DEV__) {\n    if (cache.refCount < 0) {\n      console.warn(\n        'A cache instance was released after it was already freed. ' +\n          'This likely indicates a bug in React.',\n      );\n    }","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-reconciler/src/ReactFiberCacheComponent.js#L75-L111","documentation":"Error \"A cache instance was retained after it was already freed. This likely indicates a bug in React.\" thrown in facebook/react.","triggerScenarios":"Thrown at packages/react-reconciler/src/ReactFiberCacheComponent.js:93 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":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}