facebook/react · error · 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 a client reference, resolveClientReferenceMetadata looks up the module id and export name in the turbopack-generated client manifest (bundlerConfig), including the '*' whole-module fallback. A miss means the client bundle's manifest does not match the server bundle that serialized the reference — the message blames the bundler because both compilations should be atomic.

Source

Thrown at packages/react-server-dom-turbopack/src/client/ReactFlightClientConfigBundlerTurbopack.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];
    }
    if (isAsyncImport(metadata)) {
      return [
        resolvedModuleData.id,
        resolvedModuleData.chunks,
        name,
        1 /* async */,
      ];
    } else {
      return [resolvedModuleData.id, resolvedModuleData.chunks, name];
    }

View on GitHub (pinned to eafeac097b)

Solutions

  1. Delete the build/dev cache (.next, turbopack cache) and restart the dev server
  2. Ensure server and client compile in one build step — never ship artifacts from two different builds
  3. After upgrading the framework or React, clear persistent caches before debugging further

Example fix

# before
$ next dev   # stale manifest -> runtime error on client reference

# after
$ rm -rf .next
$ next dev
Defensive patterns

Strategy: validation

Validate before calling

import {bundlerConfig} from './turbopack-client-manifest';
function clientReferenceResolves(id, name) {
  const m = bundlerConfig[id];
  return Boolean(m && (m[name] || m['*']));
}
// before rendering a payload produced by another build:
if (!clientReferenceResolves(refId, refName)) {
  throw new Error('Client manifest out of sync; rebuild server and client together');
}

Prevention

When it happens

Trigger: Server and client compiled at different times: stale dev-server cache after editing 'use client' files, partial rebuild after a crashed watcher, CI mixing artifacts from two builds, or a turbopack persistent cache reused across a toolchain upgrade.

Common situations: Editing components while the dev server crashed then restarting against a warm cache; upgrading Next.js/React versions with persistent caching enabled; deploying server and client bundles from different CI jobs.

Related errors


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