Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome Extension is not working due to empty moduleInfo #2673

Closed
5 tasks done
benmarch opened this issue Jun 26, 2024 · 3 comments
Closed
5 tasks done

Chrome Extension is not working due to empty moduleInfo #2673

benmarch opened this issue Jun 26, 2024 · 3 comments

Comments

@benmarch
Copy link
Contributor

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:

const [module, setModule] = useState(window.__FEDERATION__?.moduleInfo || {});

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
Copy link
Member

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
Copy link
Contributor Author

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

@benmarch
Copy link
Contributor Author

benmarch commented Jul 8, 2024

I was able to get this working by making some changes to my runtime plugin. I opened a PR with similar changes in case you want to incorporate them; should be a non-breaking change: #2726

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants