Skip to content

Conversation

@Jaouan
Copy link

@Jaouan Jaouan commented Oct 15, 2025

Description

Fixes a bug occurring when loading a VitePluginFederation remote in an application that mixes ModuleFederation and VitePluginFederation remotes.

When a remote ModuleFederation is already present in the share scope, a loading: null property is set (source).
During share scope merging, since typeof null === "object", the call to Object.assign(null, …) throws the following error: Cannot convert undefined or null to object.

This fix adds a null check to prevent calling Object.assign on a null value.

(maybe it is recommended to have a dedicated scope for this kind of case?)

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Code of Conduct and follow the Commit Convention guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant