question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lot's of Warnings when using Webpack Module Federation

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

In our project, we’re using Webpack Module Federation with the following share:

    new ModuleFederationPlugin({

        shared: {
            ...deps,

            "@mui/private-theming": {singleton: true},
            "@mui/material/styles": {singleton: true},
            "@mui/styles": {singleton: true},

            "react": {singleton: true},
            "react-dom": {singleton: true},

When building our project we’ve a lot of warnings like the following:

WARNING in shared module @mui/material/styles
No required version specified and unable to automatically determine one. Unable to find required version for "@mui/material" in description file (/home/mpo/icCube/gh/icCubeReportingMF/ic3-reporting/node_modules/@mui/lab/CalendarPicker/package.json). It need to be in dependencies, devDependencies or peerDependencies.

It seems the CalendarPicker/package.json file is missing the following:

  "peerDependencies": {
    "@mui/material": "^5.0.0"
  }

With this peerDependencies the warning disappear. There’s a lot as well with ‘react’ dependency missing…

Does anybody experience the same issue? Am I missing something with my setup?

If not would it be possible to update the package.json in the MUI project?

Let me know if you need more info.

Expected behavior 🤔

No such warnings.

Steps to reproduce 🕹

Steps:

  1. Build a project with Webpack Module Federation as shown in the description of this issue.

Context 🔦

No response

Your environment 🌎

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
marc-polizzicommented, Jan 24, 2022

@mnajdova still several warnings w/ latest (5.2.3)… we’ve done a small script to add “missing” dependencies for all files triggering a warning in our node_modules/

0reactions
marc-polizzicommented, May 31, 2022

@mnajdova nothing new since the reporting of that issue and my latest comment. still running a script to remove those warnings.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lot's of Warnings when using Webpack Module Federation
When building our project we've a lot of warnings like the following: WARNING in shared module @mui/material/styles No required version ...
Read more >
Module Federation - webpack
The container tries to provide shared modules, but if the shared module has already been used, a warning and the provided shared module...
Read more >
Webpack Module Federation loads chunks from wrong URL
I am building a project with webpack module federation with the following setup: React host (running on localhost:3000 ); Angular Remote 1 ...
Read more >
Pitfalls with Module Federation and Angular
In this article, I'm going to destroy my Module Federation example! However, you don't need to worry: It's for a very good reason....
Read more >
Five Module Federation/Micro-Frontend Mistakes - YouTube
Module Federation is an advanced front-end topic, that's for sure, so let's talk about some mistakes that people make, and misconceptions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found