Webpack module federation breaks with multiple entrypoints
See original GitHub issueThis time it’s @sokra who told me this is probably the place to open an issue.
- Operating System: Windows 10
- Node Version: 12.16.2
- NPM Version: 6.14.4
- webpack Version: 5.0.0-beta.22
- webpack-dev-server Version: 3.11.0
- Browser: Chrome 84.0.4147.105, Firefox 79.0, Edge 84.0.522.48
- This is a bug
Code
https://github.com/codepunkt/module-federation-examples/tree/dynamic-host-remote
Expected Behavior
Using webpack-dev-server
instead of webpack
should still support module federation with additional content tacked onto the remoteEntry by defining it as an additional entry
.
Actual Behavior
Running “yarn start” to start webpack-dev-server
breaks module federation and thus breaks the app in development mode.
For Bugs; How can we reproduce the behavior?
- clone repository
- ensure you’re on branch “dynamic-host-remote”
- run
yarn
on repo root - go into “dynamic-host-remote” directory
- run
yarn start
in “dynamic-host-remote” directory - open
localhost:3001
in the browser - encounter an error in the browser console that happens when executing app2/remoteEntry.js with the additional contents that were added to this entrypoint by
webpack-dev-server
- OPTIONAL: run
yarn build && yarn serve
and revisitlocalhost:3001
to see production build working just fine.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:18
- Comments:88 (47 by maintainers)
Top Results From Across the Web
Module Federation - webpack
Multiple separate builds should form a single application. These separate builds act like containers and can expose and consume code between builds, ...
Read more >Tutorial - A Guide to Module Federation for Enterprise
Changes required on multiple files in different projects increase the likelihood of mistakes occurring and code breaking in production.
Read more >How to create multiple entry points(index.js) for a single react ...
You can do this settings in webpack.config.js. module.exports = { entry: { bundle1: "path for index1.js", bundle2: "path for index2.js" } ...
Read more >Micro-FE Architecture: Webpack 5, Module Federation, and ...
In the context of Module Federation, startup code is an implementation tactic to ... If two entry points have the same group or...
Read more >Pitfalls with Module Federation and Angular
The Microfrontend Revolution: Module Federation in Webpack 5 ... with other packages using secondary entry points, e. g. @angular/material .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@raix Here fix https://github.com/webpack/webpack-dev-server/pull/2920, can you try locally? I need rewrite some tests, if it will work I will focus on it and will do release, I already work on webpack-dev-server (focused on webpack-cli and webpack-dev-server, want to finish all problem to move ahead)
Fully work on the next releases (included stable release) will be started on the next week