Skip to content

fix(runtime-core): tolerate unavailable remote manifests during sharing - #5136

Open
tonoizer wants to merge 2 commits into
module-federation:mainfrom
tonoizer:fix/runtime-core-share-manifest-fallback
Open

tonoizer wants to merge 2 commits into
module-federation:mainfrom
tonoizer:fix/runtime-core-share-manifest-fallback

Conversation

@tonoizer

@tonoizer tonoizer commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

With version-first sharing, an unavailable remote manifest currently rejects loadShare() even when the host or another remote can provide the shared dependency. Move remote resolution into the existing beforeLoadShare error boundary. When the hook returns nothing, skip the unavailable remote for that attempt; when it supplies a container, initialize it through a transient module. Because no placeholder manifest is cached, later calls can retry the remote after it recovers.

Add regression tests covering repeated loads while the manifest is unavailable, a healthy remote, recovery on a later load, and a hook-provided fallback container. Include a patch changeset for @module-federation/runtime-core.

Validation

  • corepack pnpm exec turbo run build --filter=@module-federation/runtime-core — passed.
  • corepack pnpm --filter @module-federation/runtime-core exec rstest run --include "**/*.spec.ts" — 128 tests passed.
  • corepack pnpm exec prettier --check packages/runtime-core/src/shared/index.ts packages/runtime-core/__tests__/shared-diagnostics.spec.ts .changeset/fuzzy-remotes-recover.md — passed.
  • git diff --cached --check — passed.

Local check limitations

  • corepack pnpm install --frozen-lockfile failed in the unrelated chrome-devtools postinstall because WSL is unavailable on this Windows host. corepack pnpm install --frozen-lockfile --ignore-scripts completed.
  • The package's default rstest -u command matches no tests on Windows due to its glob. The full suite passed with the explicit include pattern above.
  • Repository-wide Prettier reported existing issues in 4,303 files. node tools/scripts/check-format-changed.mjs compared against a stale local main and reported 53 unrelated files; the three PR files pass the targeted check.
  • corepack pnpm exec changeset status --verbose could not run because the Windows build of the local release-plan package references a missing ./apply-links.ts. The changeset was parsed separately and contains one patch release for runtime-core.

Risk

For a manifest failure, plugins observing both afterResolve and beforeLoadShare receive an error event at each lifecycle stage. A hook-provided container is initialized through a transient module so the manifest remains retryable.

@changeset-bot

changeset-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4a13aa9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 48 packages
Name Type
@module-federation/runtime-core Patch
@module-federation/nextjs-mf Patch
@module-federation/runtime Patch
@module-federation/bridge-react Patch
@module-federation/devtools Patch
@module-federation/dts-plugin Patch
@module-federation/esbuild Patch
@module-federation/metro Patch
@module-federation/modern-js-v3 Patch
@module-federation/modern-js Patch
@module-federation/node Patch
@module-federation/observability-plugin Patch
@module-federation/playground Patch
@module-federation/retry-plugin Patch
@module-federation/runtime-tools Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/bridge-vue3 Patch
website-new Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/metro-plugin-rock Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rstest Patch
node-dynamic-remote-new-version Patch
node-dynamic-remote Patch
@module-federation/enhanced Patch
@module-federation/rspack Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/rspress-plugin Patch
remote5 Patch
remote6 Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/cli Patch
create-module-federation Patch
@module-federation/error-codes Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/sdk Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/treeshake-frontend Patch
@module-federation/treeshake-server Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/bridge-shared Patch
@module-federation/utilities Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant