Skip to content

fix(runtime): enable SSR remote-entry retry and URL failover - #4968

Open
dmchoi77 wants to merge 2 commits into
module-federation:mainfrom
dmchoi77:fix/ssr-remote-entry-retry
Open

fix(runtime): enable SSR remote-entry retry and URL failover#4968
dmchoi77 wants to merge 2 commits into
module-federation:mainfrom
dmchoi77:fix/ssr-remote-entry-retry

Conversation

@dmchoi77

@dmchoi77 dmchoi77 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes Node.js/SSR remote-entry transport failures that currently bypass the loadEntryError lifecycle.

loadEntryNode now follows the same retryable RUNTIME_008 path as the browser loader, and the Node loader receives getEntryUrl so retry-plugin URL rewrites (domain failover and cache-busting queries) are applied during SSR as well.

Remote-entry execution failures remain non-retryable. The Node SDK now marks transport failures as ScriptNetworkError and execution failures as ScriptExecutionError; hook/configuration failures retain their original errors.

The change reuses the existing runtime error lifecycle and browser error handling pattern. No new public utility or retry API is introduced.

Regression coverage verifies:

  • Node transport failures dispatch loadEntryError and can recover with a rewritten URL.
  • Unrecovered transport failures include RUNTIME_008.
  • Remote-entry execution failures do not invoke retry handling.
  • createScript hook failures are not misclassified as network failures.
  • Node script error classification is preserved by the SDK.

Validation

All commands below were run with Node.js 24.19.0 and pnpm 10.28.0:

  • pnpm --filter @module-federation/runtime-core exec rstest run tests/node-load.spec.ts --testNamePattern='Node.js entry loading'
  • pnpm --filter @module-federation/sdk test -- --runInBand node-builtin-esm.spec.ts
  • pnpm --filter @module-federation/runtime-core test
  • pnpm --filter @module-federation/sdk test
  • pnpm --filter @module-federation/runtime-core run build
  • pnpm --filter @module-federation/sdk run build

Related Issue

Closes #4963

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3e9d2f6

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

This PR includes changesets to release 47 packages
Name Type
@module-federation/runtime-core Patch
@module-federation/sdk Patch
@module-federation/nextjs-mf Patch
@module-federation/runtime Patch
@module-federation/bridge-react Patch
@module-federation/devtools Patch
@module-federation/cli Patch
@module-federation/dts-plugin Patch
@module-federation/enhanced Patch
@module-federation/esbuild Patch
@module-federation/managers Patch
@module-federation/manifest 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/retry-plugin Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspack Patch
@module-federation/rspress-plugin Patch
@module-federation/storybook-addon Patch
@module-federation/utilities Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/bridge-vue3 Patch
@module-federation/playground Patch
@module-federation/runtime-tools Patch
website-new Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider 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
node-dynamic-remote-new-version Patch
node-dynamic-remote Patch
remote5 Patch
remote6 Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/bridge-shared Patch
@module-federation/error-codes Patch
create-module-federation Patch
@module-federation/treeshake-server Patch
@module-federation/treeshake-frontend 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13639e3681

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/sdk/src/node.ts
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.

Node/SSR remote-entry load failures do not trigger loadEntryError

1 participant