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`.
125
+
**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
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
127
128
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.
@@ -133,7 +133,63 @@ Since eager consumption wraps all dependencies inside the entry file of the remo
133
133
134
134
#### Solution 2
135
135
136
-
You are missing an "async boundary" in your application. Ensure that you have a dynamic import at the top of the application.
136
+
You are missing an "async boundary" in your application. Ensure that you have a dynamic import at the top of the application.
137
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
138
139
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).
140
+
141
+
## Unable to compile federated types, Error: compile TS failed
142
+
143
+
#### Error Message
144
+
:::danger Browser Error Message
145
+
Unable to compile federated types, Error: compile TS failed, the original command is 'npx tsc --project file-path.json'.
146
+
:::
147
+
148
+
:::danger Browser Error Message
149
+
Error: ENOENT: no such file or directory, open 'project-path/rspack_hmr/application-name/dist/@mf-types.zip'
150
+
:::
151
+
152
+
#### Solution
153
+
154
+
Credits to [@2heal1](https://github.com/2heal1), [@pganster](https://github.com/pganster) and [@jeremy-leclerc](https://github.com/jeremy-leclerc) for the support.
155
+
156
+
1. Make sure all errors and warnings of your Typescript compiler are resolved!
157
+
2. Check your `ModuleFederationPlugin` config field `exposes`:
0 commit comments