Skip to content

fix(runtime-core): prevent duplicate remote entry initialization#4371

Merged
2heal1 merged 2 commits intomainfrom
fix/loop-load
Feb 4, 2026
Merged

fix(runtime-core): prevent duplicate remote entry initialization#4371
2heal1 merged 2 commits intomainfrom
fix/loop-load

Conversation

@2heal1
Copy link
Member

@2heal1 2heal1 commented Feb 3, 2026

Description

Add initing flag to track initialization state and avoid concurrent init calls

Related Issue

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.

Add initing flag to track initialization state and avoid concurrent init calls
@changeset-bot
Copy link

changeset-bot bot commented Feb 3, 2026

🦋 Changeset detected

Latest commit: 72a17e4

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

This PR includes changesets to release 41 packages
Name Type
@module-federation/runtime-core Patch
@module-federation/runtime Patch
@module-federation/bridge-react Patch
@module-federation/devtools Patch
@module-federation/data-prefetch Patch
@module-federation/dts-plugin Patch
@module-federation/metro Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/retry-plugin Patch
@module-federation/runtime-tools Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/bridge-vue3 Patch
@module-federation/enhanced Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/metro-plugin-rnef Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspack Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/rspress-plugin Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/modernjsapp Patch
remote5 Patch
remote6 Patch
website-new Patch
@module-federation/sdk Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/error-codes Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/esbuild 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

@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 72a17e4
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/6981fe1f528fad0008cb47a1
😎 Deploy Preview https://deploy-preview-4371--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

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

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: 1a8159fc5d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +109 to +110
if (!this.inited && !this.initing) {
this.initing = true;

Choose a reason for hiding this comment

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

P2 Badge Reset initing when init fails to avoid permanent skip

If remoteEntryExports.init(...) or the hooks throw, initing remains true and inited stays false, so subsequent init() calls will skip initialization forever and still return remoteEntryExports, leaving the remote uninitialized. This only happens after a transient failure (network error, bad remote entry, hook exception), but in that case it permanently blocks recovery in the same process. Consider resetting initing in a finally/catch so a later retry can re-run initialization.

Useful? React with 👍 / 👎.

@2heal1 2heal1 merged commit 6590738 into main Feb 4, 2026
22 checks passed
@2heal1 2heal1 deleted the fix/loop-load branch February 4, 2026 02:33
@2heal1 2heal1 mentioned this pull request Feb 4, 2026
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