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 client reference, it resolves the module path (possibly encoded as 'path#exportName') against the React Client Manifest that the bundler plugin emitted. This error means config lookup failed for both the exact path and the '#'-split base module — the server knows about a client module the manifest has no entry for, so it cannot emit chunk coordinates for the client to load.
Source
Thrown at packages/react-server-dom-unbundled/src/server/ReactFlightServerConfigUnbundledBundler.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
- Rebuild so the client manifest is regenerated alongside the server bundle and both are loaded from the same build
- Add the file, directory, or glob covering the missing module to the ReactFlightWebpackPlugin clientReferences option (or ensure the file has 'use client' where the toolchain scans)
- If you register client references manually, use the exact module id/paths the manifest keys use, including the '#name' encoding when referring to a named export
- Verify the server actually loads the new manifest (log Object.keys(config) length) rather than a cached old one
Example fix
// before: workspace components never scanned
new ReactFlightWebpackPlugin({isServer: false, clientReferences: [{directory: './src', recursive: true}]});
// after: include the components package
new ReactFlightWebpackPlugin({
isServer: false,
clientReferences: [
{directory: './src', recursive: true},
{directory: './packages/ui/src', recursive: true, include: /\.(js|ts|jsx|tsx)$/},
],
}); Defensive patterns
Strategy: validation
Validate before calling
// Server-side: verify a module path (with optional '#name') exists before serializing
function assertInClientManifest(clientManifest, modulePath) {
const base = modulePath.includes('#') ? modulePath.slice(0, modulePath.lastIndexOf('#')) : modulePath;
if (!clientManifest[base]) {
throw new Error(`client manifest missing ${base} — widen clientReferences and rebuild`);
}
} Prevention
- Keep plugin clientReferences globs covering every 'use client' module including workspace packages
- Regenerate the client manifest in the same CI step as the server bundle
- Add a build check that fails when a 'use client' file compiles but has no manifest entry
When it happens
Trigger: Serializing a component from a 'use client' module whose path is absent from the client manifest passed to the server's bundler config; using registerClientReference with an id that was never emitted into the manifest; a '#' encoded reference whose base module is missing.
Common situations: Client components in packages/workspace folders not covered by the plugin's clientReferences globs; stale react-client-manifest.json from an earlier build; mixing manual registerClientReference ids with plugin-generated manifests; monorepos where the manifest only covers the app directory.
Related errors
- Could not find the module "${metadata[ID]}" in the React Ser
- The module "${modulePath}" is marked as an async ESM module
- Invalid server action: ${ref}
- Could not find the module "${metadata[ID]}" in the React Ser
- Use react-server-dom-webpack/client instead.
AI-assisted analysis of facebook/react@eafeac097b (2026-08-21).
Data as JSON: /api/errors/ec5586caa70eb564.
Report an issue: GitHub.