facebook/react · error · Error

442

442

Error message

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

What it means

React's Resource system (float): hoistable elements like <link rel="stylesheet" precedence>, <title>, <meta>, and async <script> are managed as Resources by the reconciler. Renderers that don't implement the Resource API re-export ReactFiberConfigWithNoResources, where isHostHoistableType and the other resource hooks are throwing shims (`supportsResources = false`). Rendering a hoistable element against such a config throws this error.

Source

Thrown at packages/react-reconciler/src/ReactFiberConfigWithNoResources.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 hydration
// can re-export everything from this module.

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

export type HoistableRoot = mixed;
export type Resource = mixed;

// Resources (when unsupported)
export const supportsResources = false;
export const isHostHoistableType = shim;
export const getHoistableRoot = shim;
export const getResource = shim;
export const acquireResource = shim;
export const releaseResource = shim;
export const hydrateHoistable = shim;
export const mountHoistable = shim;

View on GitHub (pinned to eafeac097b)

Solutions

  1. Drop the `precedence` prop (a plain <link> without precedence is a normal host element, not a Resource) or render the link via a <head>-injected script on non-DOM targets.
  2. Gate Resource-based elements to react-dom: render them only when running in a DOM environment.
  3. Custom renderer authors: implement the Resources API in your host config if your target can manage hoistables.

Example fix

// before: Resource API on a renderer without support
<link rel="stylesheet" href="/app.css" precedence="default" />

// after: plain element, or DOM-only branch
{isDom ? (
  <link rel="stylesheet" href="/app.css" precedence="default" />
) : null}
Defensive patterns

Strategy: type-guard

Validate before calling

// Only emit Resource-based elements where the renderer supports them
const isDom = typeof document !== 'undefined';
const styleLink = isDom
  ? <link rel="stylesheet" href="/app.css" precedence="default" />
  : null;

Type guard

function isHoistableResourceElement(element) {
  if (!element || typeof element !== 'object') return false;
  const t = element.type;
  if (t === 'link') return Boolean(element.props?.precedence);
  return t === 'title' || t === 'meta' || (t === 'script' && element.props?.async);
}

Prevention

When it happens

Trigger: Rendering <link rel="stylesheet" href="..." precedence="default"> (or <title>, <meta>, <script async src>) inside a tree driven by a renderer whose host config re-exports NoResources — react-native, art, test renderers, most custom renderers.

Common situations: Sharing component libraries between web and react-native/custom renderers where styles are emitted via precedence-based <link> tags; testing DOM components with React Test Renderer.

Related errors


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