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
- Delete the build/dev cache (.next, turbopack cache) and restart the dev server
- Ensure server and client compile in one build step — never ship artifacts from two different builds
- 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
- Produce server and client bundles from a single build step
- Treat persistent caches as invalid across framework/React upgrades
- Clear the dev cache whenever references fail to resolve after edits
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
- Could not find the module "${id}" in the React Server Manife
- Could not find the module "${modulePath}" in the React Clien
- The module "${modulePath}" is marked as an async ESM module
- Could not find the module "${metadata[ID]}" in the React Ser
- react-dom/client is not supported in React Server Components
AI-assisted analysis of facebook/react@eafeac097b (2026-08-21).
Data as JSON: /api/errors/b659700216bc8daf.
Report an issue: GitHub.