Skip to content

Runtime init and loadRemote methods are contain different remote (FederationInstance) when trying load exposed module #1942

@satheesh66

Description

@satheesh66

Describe the bug

Hi,
I have using module-federation/runtime ,

I am trying to load the remote and then trying access the exposed module , here my host is main

image

when invoke loadRemote method the FederationInstance is not holding main instead it holds other remote that is previously loaded because of the condition in @module-federation/runtime's init method in line number 1684, since we declared the FederationInstance variable outside of the init and loadRemote method's scope, so it holding previous remote.

image

if i change the condition to if(FederationInstance !== instance) it's working as expected,

Reproduction

Used Package Manager

npm

System Info

Os : Mac os sonoma 14.1.2,
Browser : Brave

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions