Module Federation - Some chunks are not loaded when navigating from the Remote module to the Host module #18178
Unanswered
andre-lima
asked this question in
Q&A
Replies: 2 comments 5 replies
-
Hello, can you provide a reproducible example? I understand that the application can be large, but we need to somehow reproduce your problem to understand why it is happening, unfortunately the current information is not enough to determine it, I can't say why it happens |
Beta Was this translation helpful? Give feedback.
1 reply
-
@andre-lima can you share your webpack configs here. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bug report
What is the current behavior?
In our application we use Module Federation to break the monolith. Currently, all modules' files (Host and Remote) live in the same repository, divided into different folders with their own dependencies.
Our current setup functions in a bi-directional mode, in which, the "true” host exposes contexts & common components, and the remotes expose their pages.
We’re facing an issue when running the application in production mode only. When we reload the browser while in a route managed by the Remote module then we leave to the Host application, some of the chunks necessary to run the Host are not loaded by the browser, breaking the application.
This does not occur in development mode.
This also does not occur if we manually add the missing functionality/components to the list of exposed components in the Host’s Module Federation configuration. The thing is, these components are not needed in the Remote module, so in our opinion, they shouldn’t need to be exposed in the first place.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
When navigating to the Host module from the Remote one, all missing chunks should be loaded, and no errors are thrown.
Other relevant information:
webpack version: 5.90.3
Node.js version: 16.20.1
Operating System: MacOS Venture 13.5
Additional tools: Module Federation
Beta Was this translation helpful? Give feedback.
All reactions