facebook/react · critical · Error

Could not find the module "${metadata[ID]}" in the React Ser

Error message

Could not find the module "${metadata[ID]}" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.

What it means

When the Flight client decodes an RSC payload, every client reference is resolved to a real module via the client manifest (the moduleMap/bundlerConfig passed to createFromReadableStream and friends). Here the module id was found, but neither the referenced export name nor the '*' whole-module fallback exists in that manifest entry, so React reports an RSC bundler bug: the server payload and the client manifest disagree.

Source

Thrown at packages/react-server-dom-webpack/src/client/ReactFlightClientConfigBundlerWebpack.js:86

  prepareDestinationWithChunks(moduleLoading, metadata[CHUNKS], nonce);
}

export function resolveClientReference<T>(
  bundlerConfig: ServerConsumerModuleMap,
  metadata: ClientReferenceMetadata,
): ClientReference<T> {
  if (bundlerConfig) {
    const moduleExports = bundlerConfig[metadata[ID]];
    let resolvedModuleData = moduleExports && moduleExports[metadata[NAME]];
    let name;
    if (resolvedModuleData) {
      // The potentially aliased name.
      name = resolvedModuleData.name;
    } else {
      // If we don't have this specific name, we might have the full module.
      resolvedModuleData = moduleExports && moduleExports['*'];
      if (!resolvedModuleData) {
        throw new Error(
          'Could not find the module "' +
            metadata[ID] +
            '" in the React Server Consumer Manifest. ' +
            'This is probably a bug in the React Server Components bundler.',
        );
      }
      name = metadata[NAME];
    }
    // Note that resolvedModuleData.async may be set if this is an Async Module.
    // For Client References we don't actually care because what matters is whether
    // the consumer expects an unwrapped async module or just a raw Promise so it
    // has to already know which one it wants.
    // We could error if this is an Async Import but it's not an Async Module.
    // However, we also support plain CJS exporting a top level Promise which is not
    // an Async Module according to the bundle graph but is effectively the same.
    if (isAsyncImport(metadata)) {
      return [
        resolvedModuleData.id,

View on GitHub (pinned to eafeac097b)

Solutions

  1. Delete all build artifacts and caches (rm -rf .next dist .turbo) and rebuild server and client together in one run
  2. Verify the export named in the error still exists in the client module and is not tree-shaken (check sideEffects and exports fields in package.json)
  3. Align versions of react, react-server-dom-webpack, and the RSC bundler plugin on both sides so manifest formats match
  4. In custom integrations, pass the manifest generated by the same build run as the client bundle (options.moduleMap)
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-flight for custom integrations: confirm every expected client ref resolves.
function manifestHas(bundlerConfig, id, name) {
  const m = bundlerConfig[id];
  return Boolean(m && (m[name] || m['*']));
}
// if (!manifestHas(moduleMap, '4211/charts', 'Chart')) fail the build instead of crashing at runtime

Try / catch

try {
  const root = await createFromReadableStream(stream, {moduleMap});
} catch (e) {
  if (String(e.message).includes('React Server Consumer Manifest')) {
    // Build-poisoning mismatch: no runtime recovery — 500 and force a clean rebuild.
    return new Response('Server/client manifest mismatch — rebuild required', {status: 500});
  }
  throw e;
}

Prevention

When it happens

Trigger: The payload contains 'moduleId#exportName' where the manifest has that module but no such export name and no '*'; the export was renamed or deleted between the server and client builds; tree-shaking removed the export from the client bundle; createFromReadableStream was given a stale or wrong moduleMap in a custom integration.

Common situations: Stale .next/dist/cache after renaming an export of a client component; server and client bundles built with different versions of the react-server-dom-webpack plugin; custom RSC setups wiring the wrong manifest into the stream options; deployed client manifest out of sync with the server bundle.

Related errors


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