You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Example scenario**: You have an npm package with `eager` remote imports (such as `import Button from 'myRemote/button'`) and share this npm package with `eager: true`.
126
+
**Example scenario**: You're sharing a mix of packages, some with `eager: true` and others with `eager: false`, and the `eager: true` packages import the `eager: false` shared packages.
127
+
128
+
This error occurs when a remote (often a library-like shared module) contains unwanted circular dependencies between the `shared dependencies` of the remote and other consumers or the host application. If the environment is using the Module Federation config `shared: { "package-name": { eager: true } }`, the Rspack/Webpack builder runtime will break with this error.
129
+
130
+
To resolve this, remove the `eager: true` option from the shared configuration of all connected remotes and the host application. This will prevent the shared dependencies from being eagerly loaded and will allow the remote to be loaded correctly.
131
+
132
+
Since eager consumption wraps all dependencies inside the entry file of the remote, Rspack/Webpack cannot detect the specific handlers for each dependency, resulting in `undefined`.
133
+
134
+
#### Solution 2
135
+
136
+
You are missing an "async boundary" in your application. Ensure that you have a dynamic import at the top of the application.
137
+
For example, if your entry point is `index.js`, copy the contents of `index.js` into a new file called `bootstrap.js`. Then, in `index.js`, replace the code with `import('./bootstrap.js')`.
138
+
139
+
Alternatively, you can try the hoisted runtime experiment, which removes the need for an async boundary in user code. Learn more here: [Hoisted Runtime Experiment](https://module-federation.io/configure/experiments.html#federationruntime).
0 commit comments