Skip to content

Commit e9f1b38

Browse files
docs: include info about cross-loading esm and non esm (module-federation#3264)
1 parent a960c88 commit e9f1b38

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

apps/website-new/docs/en/guide/basic/runtime.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ init({
4646
entry: "http://localhost:3006/remoteEntry.js",
4747
alias: "app2"
4848
},
49+
{
50+
name: "@demo/app4",
51+
entry: "http://localhost:3006/remoteEntry.mjs",
52+
alias: "app2",
53+
type: 'module' // tell federation its a certain format, like ESM module
54+
},
4955
],
5056
});
5157

apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-001.mdx

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ However, during this loading process, registered producers are inaccessible. The
1313
1. The remoteEntryUrl is not right.
1414
2. The remoteEntry file does not mount the container correctly.
1515
3. Network problem, the resource cannot be accessed.
16+
4. The remote type is a different format and not specified in either the plugin or in the `init` for the remotes details.
1617

1718
## Solutions
1819

@@ -22,3 +23,5 @@ There are corresponding solutions for the reasons:
2223
- If using manifest, check the publicPath and remoteEntry.name fields in the manifest
2324
2. If the project builder is rspack, check whether [runtimeChunk](https://rspack.dev/config/optimization#optimizationruntimechunk) is set in the final build configuration. If so, delete this configuration.
2425
3. Check if the resource is externally accessible.
26+
4. Loading a ESM remote from a non-esm host
27+
- setting `type: 'module'` on the remote config

0 commit comments

Comments
 (0)