facebook/react · error

A cache instance was retained after it was already freed. Th

Error message

A cache instance was retained after it was already freed. This likely indicates a bug in React.

What it means

Error "A cache instance was retained after it was already freed. This likely indicates a bug in React." thrown in facebook/react.

Source

Thrown at packages/react-reconciler/src/ReactFiberCacheComponent.js:93

  CacheContext._currentRenderer = null;
  CacheContext._currentRenderer2 = null;
}

// Creates a new empty Cache instance with a ref-count of 0. The caller is responsible
// for retaining the cache once it is in use (retainCache), and releasing the cache
// once it is no longer needed (releaseCache).
export function createCache(): Cache {
  return {
    controller: new AbortControllerLocal(),
    data: new Map(),
    refCount: 0,
  };
}

export function retainCache(cache: Cache) {
  if (__DEV__) {
    if (cache.controller.signal.aborted) {
      console.warn(
        'A cache instance was retained after it was already freed. ' +
          'This likely indicates a bug in React.',
      );
    }
  }
  cache.refCount++;
}

// Cleanup a cache instance, potentially freeing it if there are no more references
export function releaseCache(cache: Cache) {
  cache.refCount--;
  if (__DEV__) {
    if (cache.refCount < 0) {
      console.warn(
        'A cache instance was released after it was already freed. ' +
          'This likely indicates a bug in React.',
      );
    }

View on GitHub (pinned to eafeac097b)

When it happens

Trigger: Thrown at packages/react-reconciler/src/ReactFiberCacheComponent.js:93 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of facebook/react@eafeac097b (2026-08-21). Data as JSON: /api/errors/7fb2985a5399fe74. Report an issue: GitHub.