From e9f1b38376049baf1d54c821e070205d59e9fc8c Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Mon, 25 Nov 2024 22:28:03 -0800 Subject: [PATCH] docs: include info about cross-loading esm and non esm (#3264) --- apps/website-new/docs/en/guide/basic/runtime.mdx | 6 ++++++ .../docs/en/guide/troubleshooting/runtime/RUNTIME-001.mdx | 3 +++ 2 files changed, 9 insertions(+) diff --git a/apps/website-new/docs/en/guide/basic/runtime.mdx b/apps/website-new/docs/en/guide/basic/runtime.mdx index 426bdb1948..381986a7df 100644 --- a/apps/website-new/docs/en/guide/basic/runtime.mdx +++ b/apps/website-new/docs/en/guide/basic/runtime.mdx @@ -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 + }, ], }); diff --git a/apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-001.mdx b/apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-001.mdx index e308c9056b..f348fc57ed 100644 --- a/apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-001.mdx +++ b/apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-001.mdx @@ -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 @@ -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