facebook/react · error · Error

This module must be shimmed by a specific renderer.

Error message

This module must be shimmed by a specific renderer.

What it means

ReactFlightClientConfig is a placeholder module: React's Rollup, Jest, and Flow setups are supposed to alias (shim) every import of it to a concrete host config provided by a renderer or a generic npm shim. The file exists only so that a broken configuration fails loudly - importing it throws immediately rather than resolving to half-working defaults. Seeing this error means module resolution landed on the raw placeholder instead of the shim.

Source

Thrown at packages/react-client/src/ReactFlightClientConfig.js:20

 * 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
 */

/* eslint-disable react-internal/prod-error-codes */

// We expect that our Rollup, Jest, and Flow configurations
// always shim this module with the corresponding host config
// (either provided by a renderer, or a generic shim for npm).
//
// We should never resolve to this file, but it exists to make
// sure that if we *do* accidentally break the configuration,
// the failure isn't silent.

throw new Error('This module must be shimmed by a specific renderer.');

View on GitHub (pinned to eafeac097b)

Solutions

  1. Import public entry points (react, react-dom, react-server-dom-webpack/client) instead of deep internal paths like react-client/src/*
  2. Restore the alias config: in Jest add the moduleNameMapper entries mapping the config module to your host shim; in Rollup apply the same alias/resolution plugin React's own build uses
  3. Upgrade (or downgrade-match) react, react-dom, and react-server-dom-* together so their internal import graphs are consistent with the shim set you have
  4. Grep your dependency graph for deep imports of react internals and replace them with supported APIs

Example fix

// jest.config.js - before: no mapper, internals resolve to placeholder
module.exports = {};

// jest.config.js - after: shim internal config modules
module.exports = {
  moduleNameMapper: {
    '^react-client/flight-client-config$': '<rootDir>/scripts/flightClientShim.js',
  },
};
Defensive patterns

Strategy: validation

Validate before calling

// CI guard: fail the build if any deep import of React internals slips in
// package.json "scripts": { "check:imports": "node scripts/check-react-imports.js" }
// scripts/check-react-imports.js
const {execSync} = require('child_process');
const out = execSync('git grep -nE "from [\\"']react-(client|server)/src/" || true').toString();
if (out.trim()) {
  console.error('Deep React internal import found - use public entry points:');
  console.error(out);
  process.exit(1);
}

Prevention

When it happens

Trigger: A bundler or test runner that ignores React's package exports/aliases and resolves an internal 'react-client/...' or flight-client-config import to the source file; Jest configs missing the moduleNameMapper entries React's repo defines; a custom/forked React build where the shim plugin was not applied; deep-importing react internals from third-party code.

Common situations: Contributing to React with a modified Jest/Rollup setup; a downstream package deep-importing internal Flight modules; upgrading React packages where the internal module graph changed and old aliases no longer cover every import site; bundling React from source with custom config.

Related errors


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