You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chrome DevTools extension crashes after refreshing the inspected page when Loading Trace is enabled and the Module Info tab is selected.
mf-devtools.mov
In this state, the injected post-message-start script can read window.__FEDERATION__?.moduleInfo before module info is available. The value is undefined, and sanitizePostMessagePayload serializes it as the string "[undefined]".
Because "[undefined]" is truthy, the page message listener can relay it as moduleInfo. getGlobalModuleInfo then stores the value on window.__FEDERATION__.moduleInfo. Later, the Module Info UI iterates over the value and checks fields such as remotesInfo, which can crash because the snapshot is a string rather than a module info object.
Observed console output includes:
moduleInfo: "[undefined]"
originModuleInfo: "[undefined]"
Uncaught TypeError: Cannot use 'in' operator to search for 'remotesInfo' in [
at main.js:85478:3181
at Array.map (<anonymous>)
at Home (main.js:85478:3054)
at renderWithHooks (main.js:20923:21)
at updateFunctionComponent (main.js:23069:15)
at beginWork (main.js:24045:14)
at performUnitOfWork (main.js:27877:14)
at workLoopSync (main.js:27754:37)
at renderRootSync (main.js:27735:7)
at performWorkOnRoot (main.js:27300:40)
Expected behavior:
The Module Info tab should keep working after refresh, even if module info is temporarily unavailable.
Invalid module info payloads such as "[undefined]", undefined, null, or arrays should be ignored or normalized before they reach the Module Info renderer.
Reproduction
Reproduced with @module-federation/devtools v2.5.0 on a Module Federation application. The minimal reproduction is the DevTools extension itself with the steps above: load the extension from packages/chrome-devtools/dist, open DevTools on a Module Federation page, enable Loading Trace, select Module Info, then refresh the inspected page.
Describe the bug
Chrome DevTools extension crashes after refreshing the inspected page when Loading Trace is enabled and the Module Info tab is selected.
mf-devtools.mov
In this state, the injected
post-message-startscript can readwindow.__FEDERATION__?.moduleInfobefore module info is available. The value isundefined, andsanitizePostMessagePayloadserializes it as the string"[undefined]".Because
"[undefined]"is truthy, the page message listener can relay it asmoduleInfo.getGlobalModuleInfothen stores the value onwindow.__FEDERATION__.moduleInfo. Later, the Module Info UI iterates over the value and checks fields such asremotesInfo, which can crash because the snapshot is a string rather than a module info object.Observed console output includes:
Expected behavior:
The Module Info tab should keep working after refresh, even if module info is temporarily unavailable.
Invalid module info payloads such as
"[undefined]",undefined,null, or arrays should be ignored or normalized before they reach the Module Info renderer.Reproduction
Reproduced with @module-federation/devtools v2.5.0 on a Module Federation application. The minimal reproduction is the DevTools extension itself with the steps above: load the extension from packages/chrome-devtools/dist, open DevTools on a Module Federation page, enable Loading Trace, select Module Info, then refresh the inspected page.
Used Package Manager
pnpm
System Info
Validations