{"record":{"id":"b659700216bc8daf","repo":"facebook/react","slug":"could-not-find-the-module-metadata-id-in-the","errorCode":null,"errorMessage":"Could not find the module \"${metadata[ID]}\" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.","messagePattern":"Could not find the module \"(.+?)\" in the React Server Consumer 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-turbopack/src/client/ReactFlightClientConfigBundlerTurbopack.js","lineNumber":86,"sourceCode":"  prepareDestinationWithChunks(moduleLoading, metadata[CHUNKS], nonce);\n}\n\nexport function resolveClientReference<T>(\n  bundlerConfig: ServerConsumerModuleMap,\n  metadata: ClientReferenceMetadata,\n): ClientReference<T> {\n  if (bundlerConfig) {\n    const moduleExports = bundlerConfig[metadata[ID]];\n    let resolvedModuleData = moduleExports && moduleExports[metadata[NAME]];\n    let name;\n    if (resolvedModuleData) {\n      // The potentially aliased name.\n      name = resolvedModuleData.name;\n    } else {\n      // If we don't have this specific name, we might have the full module.\n      resolvedModuleData = moduleExports && moduleExports['*'];\n      if (!resolvedModuleData) {\n        throw new Error(\n          'Could not find the module \"' +\n            metadata[ID] +\n            '\" in the React Server Consumer Manifest. ' +\n            'This is probably a bug in the React Server Components bundler.',\n        );\n      }\n      name = metadata[NAME];\n    }\n    if (isAsyncImport(metadata)) {\n      return [\n        resolvedModuleData.id,\n        resolvedModuleData.chunks,\n        name,\n        1 /* async */,\n      ];\n    } else {\n      return [resolvedModuleData.id, resolvedModuleData.chunks, name];\n    }","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server-dom-turbopack/src/client/ReactFlightClientConfigBundlerTurbopack.js#L68-L104","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\n$ next dev   # stale manifest -> runtime error on client reference\n\n# after\n$ rm -rf .next\n$ next dev","handlingStrategy":"validation","validationCode":"import {bundlerConfig} from './turbopack-client-manifest';\nfunction clientReferenceResolves(id, name) {\n  const m = bundlerConfig[id];\n  return Boolean(m && (m[name] || m['*']));\n}\n// before rendering a payload produced by another build:\nif (!clientReferenceResolves(refId, refName)) {\n  throw new Error('Client manifest out of sync; rebuild server and client together');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["react-server-components","turbopack","bundler","manifest","cache-invalidation"],"backgroundTag":"bundler-manifest-out-of-sync","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}