core
core copied to clipboard
PreloadRemote should not load shared modules again
Describe the bug
When using preloadRemote, it should verify that the shared dependencies are not already loaded.
If remote category is all
it will duplicate chunks loaded already.
In this case react is already shared by host, but when hovering on remote, localhost 3002 react is downloaded.
In this case, if i hover on remote 2 navigation link, it will call preloadRemote - but preload fetch JS that already is on the page from initial load.
Reproduction
https://github.com/module-federation/module-federation-examples/pull/3833
Used Package Manager
npm
System Info
System:
OS: macOS 14.0
CPU: (12) arm64 Apple M2 Pro
Memory: 294.48 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.16.0/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
pnpm: 8.6.8 - ~/.nvm/versions/node/v16.16.0/bin/pnpm
bun: 1.0.7 - ~/.nvm/versions/node/v16.16.0/bin/bun
Browsers:
Chrome: 124.0.6367.62
Safari: 17.0
Validations
- [X] Read the docs.
- [X] Read the common issues list.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Module federation issue and not a framework-specific issue.
- [X] The provided reproduction is a minimal reproducible example of the bug.