facebook/react · error · Error

Could not find the module "${modulePath}" in the React Clien

Error message

Could not find the module "${modulePath}" in the React Client Manifest. This is probably a bug in the React Server Components bundler.

What it means

When the Flight server serializes a 'use client' reference, resolveClientReferenceMetadata looks up the reference's $$id (e.g. 'path/to/module.tsx#exportName') in the React Client Manifest produced by the Turbopack React Server Components bundler. If neither the full key nor the module portion before the last '#' exists in the manifest, serialization cannot map the component to a chunk id, so React throws and blames the bundler: a manifest that omits a module the server graph references is a bundler bug, not a user error.

Source

Thrown at packages/react-server-dom-turbopack/src/server/ReactFlightServerConfigTurbopackBundler.js:66

): ClientReferenceMetadata {
  const modulePath = clientReference.$$id;
  let name = '';
  let resolvedModuleData = config[modulePath];
  if (resolvedModuleData) {
    // The potentially aliased name.
    name = resolvedModuleData.name;
  } else {
    // We didn't find this specific export name but we might have the * export
    // which contains this name as well.
    // TODO: It's unfortunate that we now have to parse this string. We should
    // probably go back to encoding path and name separately on the client reference.
    const idx = modulePath.lastIndexOf('#');
    if (idx !== -1) {
      name = modulePath.slice(idx + 1);
      resolvedModuleData = config[modulePath.slice(0, idx)];
    }
    if (!resolvedModuleData) {
      throw new Error(
        'Could not find the module "' +
          modulePath +
          '" in the React Client Manifest. ' +
          'This is probably a bug in the React Server Components bundler.',
      );
    }
  }
  if (resolvedModuleData.async === true && clientReference.$$async === true) {
    throw new Error(
      'The module "' +
        modulePath +
        '" is marked as an async ESM module but was loaded as a CJS proxy. ' +
        'This is probably a bug in the React Server Components bundler.',
    );
  }
  if (resolvedModuleData.async === true || clientReference.$$async === true) {
    return [resolvedModuleData.id, resolvedModuleData.chunks, name, 1];
  } else {

View on GitHub (pinned to eafeac097b)

Solutions

  1. Delete all build artifacts and bundler caches (.next, .turbo, node_modules/.cache) and rebuild so the client manifest and bundles are generated in one pass.
  2. Verify the server runtime consumes the client manifest emitted by the same build that compiled the server bundle (never persist a manifest across builds in CI or Docker layers).
  3. Align versions: use the react-server-dom-turbopack build shipped with your framework version instead of pinning a mismatched React canary.
  4. If it reproduces from a clean build, print the missing modulePath, diff it against the manifest keys, and report it as a bug to the React/Turbopack (or framework) repository.

Example fix

# before: stale manifest reused across builds
COPY .next/ .next/
node server.js

# after: always rebuild server + client manifest together
RUN pnpm build
node server.js
Defensive patterns

Strategy: try-catch

Validate before calling

// Before rendering, verify every referenced client id resolves in the manifest
function assertClientReferences(manifest, clientIds) {
  for (const id of clientIds) {
    if (!manifest[id] && !manifest[id.slice(0, id.lastIndexOf('#'))]) {
      throw new Error('Client manifest is missing entry: ' + id);
    }
  }
}

Try / catch

try {
  const stream = renderToPipeableStream(<App />, {onError});
  stream.pipe(res);
} catch (e) {
  if (/Could not find the module .* in the React Client Manifest/.test(String(e.message))) {
    // stale/mismatched build: fail loudly, trigger a clean rebuild
    console.error('RSC client manifest out of sync - rebuild server+client together');
  }
  throw e;
}

Prevention

When it happens

Trigger: renderToPipeableStream/renderToReadableStream reaches a client component whose id is missing from the client manifest config: config[modulePath] is undefined AND config[modulePath.slice(0, lastIndexOf('#'))] is also undefined (no '*' style fallback entry either).

Common situations: Server and client bundles produced by different/stale builds (reused .next or turbopack cache); a client manifest from a previous compile served to a freshly built server; framework canary (Next.js + Turbopack) bugs that drop manifest entries; mixing react-server-dom-turbopack builds with an incompatible bundler version.

Related errors


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