ModuleFederation how to ensure chunk load uniqueness? #19524
Unanswered
DelTheCode
asked this question in
Q&A
Replies: 1 comment
-
This shouldn't happen, other things can be broken too, I strongly recommend to avoid such situation and always use
is not unique too (in very exotic and rare cases)
We recommend to use Feel free to feedback |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Bug report
if(key !== undefined) {
var scripts = document.getElementsByTagName("script");
for(var i = 0; i < scripts.length; i++) {
var s = scripts[i];
if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
}
}
this key is chunkId, if have muti remote, probability will be same, why not set zhe key is chunkId + hash? Although I know that currently it is recommended to use output/uniqueName to ensure the uniqueness of the prefix, but wouldn't it be better to do so
What is the current behavior?
when muti remote entry, probability will not load some chunk
If the current behavior is a bug, please provide the steps to reproduce.
1、load muti remote entry
2、the remote lib with the same package name
What is the expected behavior?
in JsonpChunkLoadingRuntimeModule.js

here replace
${RuntimeGlobals.getChunkScriptFilename}(chunkId)
Other relevant information:
webpack version: "^5.54.0"
Node.js version: 18
Operating System: mac os
Additional tools:
Beta Was this translation helpful? Give feedback.
All reactions