webpack / webpack/webpack-dev-server
Webpack module federation breaks with multiple entrypoints
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.8k
- Forks
- 1.5k
- Avg merge
- 5h 32m
- Merged PRs (30d)
- 6
Description
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?
- clone repository
- ensure you're on branch "dynamic-host-remote"
- run
yarnon repo root - go into "dynamic-host-remote" directory
- run
yarn startin "dynamic-host-remote" directory - open
localhost:3001in 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 serveand revisitlocalhost:3001to see production build working just fine.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the linked module-federation-examples repository, check out dynamic-host-remote, install dependencies, and run yarn start in that directory. Compare the failing localhost:3001 development run with yarn build && yarn serve, which reportedly works. Investigate the additional contents added to app2/remoteEntry.js; done means module federation works with webpack-dev-server and the additional entry content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, webpack
- Domain
- build-system, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100