Skip to content

remotes initialized but is empty in other containers (federation runtime) #3466

Open
@hosseinmd

Description

Describe the bug

i have called init method of federation runtime in main container(or host)
import { init } from '@module-federation/runtime';
other containers doesn't know what the remotes are initialized in main container for solving this i add a patch to @module-federation/runtime-core

-            remotes: [],
+            remotes: CurrentGlobal.__FEDERATION__?.remotes || [],
             shared: {},

dev mode working after this change

to repreduce
https://github.com/callstack/super-app-showcase
in super-app-showcase remove remotes from ModuleFederationPluginV2 of all containers and add an init in host

Reproduction

https://github.com/callstack/super-app-showcase

Used Package Manager

npm

System Info

"@module-federation/enhanced": "0.8.7",

Validations

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