-
Notifications
You must be signed in to change notification settings - Fork 1
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
MAIN ISSUE: MFEs uses latest and not required package versions #2
Comments
So your expect is when visit And when visit Am i understand correctly ? |
It seems to run well if it follows my understanding, so I doubt i misunderstood... |
I expect
In our product, we use a different internal external library, I tried to reproduce the issue with a new library I created - The problem with our product:
I hope it's clear. |
Got it , that's quite clear , I will locate the issue |
But i find the demo's behavior is satisfy your required . mfe-remote-1-child-1 use |
That's a really nice way to check it! I tried it, too, and it seems that the correct versions are coming. About the FEDERATION data: |
hmm that's a problem ,it looks like the data visible has some error, I will check it on Monday. And you can check whether the real shared has worked as expected. |
Hi @2heal1, Additionally, I have created a new version 2.1.4 for the external-package-version-display package. Now, this package uses I have set the
And for the
Please note that in this version, The results are:
How to fix it? In our project, we have dozens of MFEs, and both packages are used in our MFEs in different versions. Is this a module federation bug? We're doing something wrong? |
Let me check this |
This is is module federation bug with shared initializeSharing , I will fix it this week |
Let me know if you need any help, I'm available anytime. |
Hey @2heal1 do you have any update regarding this issue |
Yes, i'm fixing it , because it needs to modify both rspack and mf code , so it still needs some time |
I check again . The issue can be fixed by rspack update sub dep shareConfig . @ahabhgk if users not specify set requiredVersion , the scopeToSharingDataMapping shareConfig's requiredVersion should be The reproduce repo: https://github.com/2heal1/modernjs-demo/tree/chore/unexpected-required-version |
hi @haimrait @idonava , i locate the issue reason : And then , since So And because you set shared as follows shared: {
...pkg.dependencies,
} it equals "external-package-version-display-2": {
singleton: false,
requiredVersion: '1.0.0',
strictVersion:true
},
"external-package-version-display": {
singleton: false,
requiredVersion: '2.1.4',
strictVersion:true
}, So it will make external-package-version-display load The related change you can view this for details https://github.com/2heal1/base-mf-app/tree/fix/main-issue And I will release new version next week for above change |
@2heal1, that's great! I really appreciate your efforts to help us & make module federation a much better product. |
it needs [email protected] and @module-federation/[email protected] Above deps have been released now , but since you are using rsbuild , you can wait 2 days for release new version or override the deps |
hey the rsbuild has released version And this is related demo: https://github.com/2heal1/base-mf-app/tree/fix/main-issue |
Thanks @2heal1,
Share Scope UsingI also tried to add a unique When I manually copy |
It's a demand that host can control the deep shared dep's shareConfig, which like conditional override . It can not support the demand now , but i can support it in the future after discuss with my team. |
But i have a question , does MF 1.0 support it ? I'm really curious about it ... |
It probably worked the same on MF 1.0. |
I just discuss with my teammate , the override share is a bit complex to maintain , one solution for you is you can use external promise to control the dpes which need strict version https://webpack.js.org/configuration/externals/#externalstypepromise |
you can try the workaround above , i will ask teammate to see if we can support it |
After changing the
external-package-version-display
to use themui
package for the first time in version 2.1.0, themfe-remote-1-child-1
MFE starts loading the incorrect version of "@mui/material": "5.16.6" instead of the required version "@mui/material": "5.15.2".external-package-version-display
is the only package/MFE that require "@mui/material" in version "5.16.6".MFE: mfe-remote-1-child-1
packages:
MFE: z-mfe-remote-3
packages:
The text was updated successfully, but these errors were encountered: