module-federation / core

Module Federation is a concept that allows developers to share code and resources across multiple JavaScript applications
https://module-federation.io/
MIT License
1.27k stars 182 forks source link

Chrome Extension is not working due to empty `moduleInfo` #2673

Closed benmarch closed 5 days ago

benmarch commented 6 days ago

Describe the bug

I just upgraded my NextJS MFEs to MF 2.0 and everything is working as expected. I installed the Chrome Extension to test out the proxy functionality, but it just shows an icon and "No ModuleInfo Detected". image

I looked through the source code and found this line in the devtool package that looks for window.__FEDERATION__.moduleInfo: https://github.com/module-federation/core/blob/8941ef416a375b49f3b179eab18c32f4a042c9c8/packages/chrome-devtools/src/App.tsx#L21

I can confirm that it's empty in the browser console: Screenshot 2024-06-26 at 3 32 46 PM

I can also confirm that it's empty in the nextjs-ssr example app: https://github.com/module-federation/module-federation-examples/tree/master/nextjs-ssr

Just wondering if I'm missing some config to enable it, or if it's a bug.

Reproduction

https://github.com/module-federation/module-federation-examples/tree/master/nextjs-ssr

Used Package Manager

npm

System Info

System:
    OS: macOS 13.6.7
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 530.61 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.1 - /usr/local/bin/node
    npm: 10.2.4 - /usr/local/bin/npm
    pnpm: 8.15.2 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 126.0.6478.127
    Safari: 16.6

Validations

ScriptedAlchemy commented 6 days ago

Next doesnt support most of the new ecosystem. Youd need to use the json protocol for remotes and currently i dont think next works with the json protocol / havent tried

benmarch commented 5 days ago

Ah ok gotcha, thanks! I'll close this out, but I might try to get that working locally