-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Bug report
What is the current behavior?
If I set optimization.runtimeChunk
and use dynamic remotes, the app will show a blank screen with no error.
const remotes = {
app1: `promise new Promise(resolve => {
// ...
resolve({
get: (request) => window.app1.get(request),
init: (arg) => {
try { return window.app1.init(arg) } catch { }
}
})
// ...
}
}
If the current behavior is a bug, please provide the steps to reproduce.
- Clone the repo: https://github.com/RexSkz/mf-dynamic-remotes-circular-reference
- Run
pnpm i && pnpm start
(it's a monorepo which uses pnpm workspace feature) - Open http://localhost:3000 in your browser
There is more information (also with my investigation) in this repo.
What is the expected behavior?
You will get a console trace (with the number 42
) immediately after the page is loaded.
Either removeing optimization.runtimeChunk
or using hard-coded remotes instead of dynamic remotes will solve the issue. But to fully solve it, we should pass ...args
instead of arg
in init
.
I'm not sure whether it's a documentation issue or some sort of design, please correct me if anything wrong :)
Other relevant information:
webpack version: 5.91.0
Node.js version: 18.19.0
Operating System: Windows 11
Additional tools: none