{"record":{"id":"ec5586caa70eb564","repo":"facebook/react","slug":"could-not-find-the-module-modulepath-in-the-r-ec5586","errorCode":null,"errorMessage":"Could not find the module \"${modulePath}\" in the React Client Manifest. This is probably a bug in the React Server Components bundler.","messagePattern":"Could not find the module \"(.+?)\" in the React Client Manifest\\. This is probably a bug in the React Server Components bundler\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server-dom-unbundled/src/server/ReactFlightServerConfigUnbundledBundler.js","lineNumber":66,"sourceCode":"): ClientReferenceMetadata {\n  const modulePath = clientReference.$$id;\n  let name = '';\n  let resolvedModuleData = config[modulePath];\n  if (resolvedModuleData) {\n    // The potentially aliased name.\n    name = resolvedModuleData.name;\n  } else {\n    // We didn't find this specific export name but we might have the * export\n    // which contains this name as well.\n    // TODO: It's unfortunate that we now have to parse this string. We should\n    // probably go back to encoding path and name separately on the client reference.\n    const idx = modulePath.lastIndexOf('#');\n    if (idx !== -1) {\n      name = modulePath.slice(idx + 1);\n      resolvedModuleData = config[modulePath.slice(0, idx)];\n    }\n    if (!resolvedModuleData) {\n      throw new Error(\n        'Could not find the module \"' +\n          modulePath +\n          '\" in the React Client Manifest. ' +\n          'This is probably a bug in the React Server Components bundler.',\n      );\n    }\n  }\n  if (resolvedModuleData.async === true && clientReference.$$async === true) {\n    throw new Error(\n      'The module \"' +\n        modulePath +\n        '\" is marked as an async ESM module but was loaded as a CJS proxy. ' +\n        'This is probably a bug in the React Server Components bundler.',\n    );\n  }\n  if (resolvedModuleData.async === true || clientReference.$$async === true) {\n    return [resolvedModuleData.id, resolvedModuleData.chunks, name, 1];\n  } else {","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server-dom-unbundled/src/server/ReactFlightServerConfigUnbundledBundler.js#L48-L84","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before: workspace components never scanned\nnew ReactFlightWebpackPlugin({isServer: false, clientReferences: [{directory: './src', recursive: true}]});\n\n// after: include the components package\nnew ReactFlightWebpackPlugin({\n  isServer: false,\n  clientReferences: [\n    {directory: './src', recursive: true},\n    {directory: './packages/ui/src', recursive: true, include: /\\.(js|ts|jsx|tsx)$/},\n  ],\n});","handlingStrategy":"validation","validationCode":"// Server-side: verify a module path (with optional '#name') exists before serializing\nfunction assertInClientManifest(clientManifest, modulePath) {\n  const base = modulePath.includes('#') ? modulePath.slice(0, modulePath.lastIndexOf('#')) : modulePath;\n  if (!clientManifest[base]) {\n    throw new Error(`client manifest missing ${base} — widen clientReferences and rebuild`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["react-server-components","webpack","manifest","client-reference"],"backgroundTag":"module-not-found-in-bundler-manifest","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}