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.

Webpack module federation breaks with multiple entrypoints

See original GitHub issue

This 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?

  1. clone repository
  2. ensure you’re on branch “dynamic-host-remote”
  3. run yarn on repo root
  4. go into “dynamic-host-remote” directory
  5. run yarn start in “dynamic-host-remote” directory
  6. open localhost:3001 in the browser
  7. 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
  8. OPTIONAL: run yarn build && yarn serve and revisit localhost:3001 to see production build working just fine.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:18
  • Comments:88 (47 by maintainers)

github_iconTop GitHub Comments

16reactions
alexander-akaitcommented, Jan 13, 2021

@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)

15reactions
alexander-akaitcommented, Dec 17, 2020

Fully work on the next releases (included stable release) will be started on the next week

Read more comments on GitHub >

github_iconTop 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 >

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