{"record":{"id":"f14db4379af979db","repo":"vercel/next.js","slug":"react-refresh-failed-to-get-exports-for-module","errorCode":null,"errorMessage":"[React Refresh] Failed to get exports for module: ${moduleId}.","messagePattern":"\\[React Refresh\\] Failed to get exports for module: (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/react-refresh-utils/internal/RspackReactRefresh.ts","lineNumber":22,"sourceCode":"  c: Record<string | number, { exports: unknown | (() => Promise<unknown>) }>\n}\n\n// Extracts exports from a webpack module object.\nfunction getModuleExports(moduleId: string) {\n  if (typeof moduleId === 'undefined') {\n    // `moduleId` is unavailable, which indicates that this module is not in the cache,\n    // which means we won't be able to capture any exports,\n    // and thus they cannot be refreshed safely.\n    // These are likely runtime or dynamically generated modules.\n    return {}\n  }\n\n  var maybeModule = __webpack_require__.c[moduleId]\n  if (typeof maybeModule === 'undefined') {\n    // `moduleId` is available but the module in cache is unavailable,\n    // which indicates the module is somehow corrupted (e.g. broken Webpack `module` globals).\n    // We will warn the user (as this is likely a mistake) and assume they cannot be refreshed.\n    console.warn(\n      '[React Refresh] Failed to get exports for module: ' + moduleId + '.'\n    )\n    return {}\n  }\n\n  var exportsOrPromise = maybeModule.exports\n  if (typeof Promise !== 'undefined' && exportsOrPromise instanceof Promise) {\n    return exportsOrPromise.then(function (exports) {\n      return exports\n    })\n  }\n  return exportsOrPromise\n}\n\nfunction executeRuntime(moduleExports, moduleId, webpackHot) {\n  RefreshHelpers.registerExportsForReactRefresh(moduleExports, moduleId)\n\n  if (webpackHot) {","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/react-refresh-utils/internal/RspackReactRefresh.ts#L4-L40","documentation":"RspackReactRefresh's getModuleExports warns when the webpack/rspack module cache has no entry for moduleId (runtime or dynamically generated modules), meaning exports cannot be captured for Fast Refresh; it returns an empty object so registration continues safely.","triggerScenarios":"Thrown at packages/react-refresh-utils/internal/RspackReactRefresh.ts:22 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reload the page; React Refresh could not read the module exports, usually from a transient HMR state."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}