Skip to content

Commit

Permalink
docs: include info about cross-loading esm and non esm (#3264)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy authored Nov 26, 2024
1 parent a960c88 commit e9f1b38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/website-new/docs/en/guide/basic/runtime.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ init({
entry: "http://localhost:3006/remoteEntry.js",
alias: "app2"
},
{
name: "@demo/app4",
entry: "http://localhost:3006/remoteEntry.mjs",
alias: "app2",
type: 'module' // tell federation its a certain format, like ESM module
},
],
});

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

## Solutions

Expand All @@ -22,3 +23,5 @@ There are corresponding solutions for the reasons:
- If using manifest, check the publicPath and remoteEntry.name fields in the manifest
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.
3. Check if the resource is externally accessible.
4. Loading a ESM remote from a non-esm host
- setting `type: 'module'` on the remote config

0 comments on commit e9f1b38

Please sign in to comment.