facebook/react · error · Error

361

361

Error message

The current renderer does not support test selectors. This error is likely caused by a bug in React. Please file an issue.

What it means

Test selectors power React's own test-driver APIs (findFiberRoot, getBoundingRect, getTextContent, isHiddenSubtree, matchAccessibilityProperties, focusSubtree). Renderers that don't implement them re-export ReactFiberConfigWithNoTestSelectors, where each is a throwing shim and `supportsTestSelectors = false`. Calling a test-selector API against such a renderer throws this error.

Source

Thrown at packages/react-reconciler/src/ReactFiberConfigWithNoTestSelectors.js:14

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

// Renderers that don't support test selectors
// can re-export everything from this module.

function shim(...args: any): empty {
  throw new Error(
    'The current renderer does not support test selectors. ' +
      'This error is likely caused by a bug in React. ' +
      'Please file an issue.',
  );
}

// Test selectors (when unsupported)
export const supportsTestSelectors = false;
export const findFiberRoot = shim;
export const getBoundingRect = shim;
export const getTextContent = shim;
export const isHiddenSubtree = shim;
export const matchAccessibilityRole = shim;
export const setFocusIfFocusable = shim;
export const setupIntersectionObserver = shim;

View on GitHub (pinned to eafeac097b)

Solutions

  1. Run selector-dependent tests against react-dom (jsdom/happy-dom) instead of the custom renderer.
  2. Custom renderer authors: implement the test-selector hooks in your host config if you need selector tooling.
  3. Check `supportsTestSelectors`-style capability before enabling selector-driven test paths.
Defensive patterns

Strategy: validation

Validate before calling

// Probe selector support once before running selector-based tooling
let selectorsSupported = false;
try {
  selectorsSupported = typeof rendererTestApi?.findFiberRoot === 'function';
} catch {}
if (!selectorsSupported) useDomTestEnvironment();

Prevention

When it happens

Trigger: Invoking test-selector functionality — component find/test-driver queries, DevTools element inspection helpers — while the resolved host config re-exports NoTestSelectors (react-native without the selector host config, most custom renderers).

Common situations: Running React's internal test-driver or selector-based E2E tooling against custom renderers; forks whose configs never implemented the selector hooks.

Related errors


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