Code Monkey home page Code Monkey logo

Comments (12)

ScriptedAlchemy avatar ScriptedAlchemy commented on July 17, 2024 1

Okay for the get public path thing.

You can try public path "auto" as we added support for manifest protocol to use auto mode. Now sure on getPublicPath as it's been a lower priority item right now.

from universe.

2heal1 avatar 2heal1 commented on July 17, 2024 1

hey , you can upgrade @module-federation/[email protected] and try again

from universe.

Ekaterina-T avatar Ekaterina-T commented on July 17, 2024 1

Thanks @2heal1 , no duplicates now!

from universe.

ScriptedAlchemy avatar ScriptedAlchemy commented on July 17, 2024

Can you supply a repo with a reproducible example.

from universe.

satheesh66 avatar satheesh66 commented on July 17, 2024

Here is the reproducible repo @ScriptedAlchemy kindly check and let me know how to solve this.

__federation_expose_button.js chunk request initiated two times from app1's app.js and app2's entry.js

https://github.com/satheesh66/module-federation-v2

from universe.

2heal1 avatar 2heal1 commented on July 17, 2024

It seems like preload issue , i will check again

from universe.

2heal1 avatar 2heal1 commented on July 17, 2024

Ahh i find the issue , when preload link , the crossorigin attr should be the same , now the link is :
image

and the script is :
image

so it will not work (preload)

@zhoushaw Can you help to fix it ? I'm not sure when the crossorigin should work on specific scens

from universe.

satheesh66 avatar satheesh66 commented on July 17, 2024

Okay for the get public path thing.

You can try public path "auto" as we added support for manifest protocol to use auto mode. Now sure on getPublicPath as it's been a lower priority item right now.

We can't use the auto since consumer services working as expected but the host service doesn't know the version, so we can't infer the proper public path. and auto implementation is not available inside remoteEntry.js file so that we need to change webpack filename.

i am right now using like below in runtime plugin

handlePreloadModule: (args) => { args.remoteSnapshot.publicPath = window.publicPath; return args; }

from universe.

vovkvlad avatar vovkvlad commented on July 17, 2024

is there any estimates on when new release will be published with #2580 ?
Thnx!

from universe.

satheesh66 avatar satheesh66 commented on July 17, 2024

Thanks for the quick fix @zhoushaw. I have checked with "@module-federation/enhanced": "^0.0.0-next-20240605063149" The duplicate chunk request issue is not fixed fully still some chunk requests happening two times one is from preload and another one is from remotEntry.js file. this issue not happening in the POC project but happened in my organization's code. we have a lot of services. and facing some CSS chunk ordering issues after this preload fix

here is an example, the app3 manifest.json request is happening two times when I have dependencies like app1 <-- app2 <-- app3(app1 consuming app2 and app2 consuming app3).

Screenshot 2024-06-05 at 21 16 35

added reproducible repo details - https://github.com/satheesh66/module-federation-v2

@zhoushaw @2heal1

from universe.

Ekaterina-T avatar Ekaterina-T commented on July 17, 2024

Hello,
I've got the same issue with duplicate requests. Maybe my example will be useful for fix as well.

Registered it in another thread though: module-federation/module-federation-examples#4008 .
Test repo https://github.com/Ekaterina-T/webpack.mf.csi

Also vendor chunks duplication case from discord https://discord.com/channels/1055442562959290389/1247139075673161829
image

Interesting thing here is that it doesn't happen all the time: sometimes requests get duplicated sometimes not.

from universe.

satheesh66 avatar satheesh66 commented on July 17, 2024

Thanks for fix @zhoushaw @2heal1.
But the issue is not fully resolved still I am facing a duplicate request issue even after updating @module-federation/[email protected]

image image image

In the above screenshots, you can see the same chunk requested by multiple times (check the initiator chain in those requests)

the first request from the initial host's entry.js file and further requests from other services entry.js they have also used that chunk.

let me know if miss any thing! Thanks

@ScriptedAlchemy @2heal1 @zhoushaw

from universe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.