{"record":{"id":"67e44c9ac1212aa0","repo":"facebook/react","slug":"this-module-must-be-shimmed-by-a-specific-renderer","errorCode":null,"errorMessage":"This module must be shimmed by a specific renderer.","messagePattern":"This module must be shimmed by a specific renderer\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-client/src/ReactFlightClientConfig.js","lineNumber":20,"sourceCode":" * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n/* eslint-disable react-internal/prod-error-codes */\n\n// We expect that our Rollup, Jest, and Flow configurations\n// always shim this module with the corresponding host config\n// (either provided by a renderer, or a generic shim for npm).\n//\n// We should never resolve to this file, but it exists to make\n// sure that if we *do* accidentally break the configuration,\n// the failure isn't silent.\n\nthrow new Error('This module must be shimmed by a specific renderer.');\n","sourceCodeStart":2,"sourceCodeEnd":21,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-client/src/ReactFlightClientConfig.js#L2-L21","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Import public entry points (react, react-dom, react-server-dom-webpack/client) instead of deep internal paths like react-client/src/*","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","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","Grep your dependency graph for deep imports of react internals and replace them with supported APIs"],"exampleFix":"// jest.config.js - before: no mapper, internals resolve to placeholder\nmodule.exports = {};\n\n// jest.config.js - after: shim internal config modules\nmodule.exports = {\n  moduleNameMapper: {\n    '^react-client/flight-client-config$': '<rootDir>/scripts/flightClientShim.js',\n  },\n};","handlingStrategy":"validation","validationCode":"// CI guard: fail the build if any deep import of React internals slips in\n// package.json \"scripts\": { \"check:imports\": \"node scripts/check-react-imports.js\" }\n// scripts/check-react-imports.js\nconst {execSync} = require('child_process');\nconst out = execSync('git grep -nE \"from [\\\\\"']react-(client|server)/src/\" || true').toString();\nif (out.trim()) {\n  console.error('Deep React internal import found - use public entry points:');\n  console.error(out);\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Import only public package entry points, never react internals","Keep Jest moduleNameMapper / bundler aliases in sync when upgrading React packages","Run the import-check script in CI","When forking or bundling React from source, verify the shim plugin runs over every internal config import"],"tags":["build","bundler","react-internals","module-resolution","configuration"],"backgroundTag":"missing-module-shim","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}