Module Federation NGRX Effects Not Working When Switching remote apps

45 views Asked by At

Just to be clear, I am working with module federation in the following context.

  1. Shell application which in the AppModule gives StoreModule.forRoot({}) and EffectsModule.forRoot({}).

  2. Remote App One - basic angular application without NGRX state, only http client.

  3. Remote App Two - basic STANDALONE angular application with NGRX state, exposing APP_ROUTES to the shell, and every route points to a lazy loaded feature inside this standalone app. At its APP_ROUTES I have provided StoreModule.forFeature(...) and EffectsModule.forFeature(...).

Having in mind this context I encounter a specific problem with Effects.

It took me a lot of time to realize that effects are crashing, but let's first explain. First of all, if I run the app two standalone it works perfectly with ngrx state, effects and so on.

If I run the app two in shell, works fine if I open it as the frist app in the shell, otherwise if I open app one and then app two, the app two effects are not registered for some reason.

If I am on the route shell/appTwo and give refresh to window, everything works nice for app two, with ngrx state effects in shell.

If I am on the route shell/appOne and switch to shell/appTwo, then appTwo effects are crashed.. not reached

Any of you encountered this issue?

I have tried the above steps mentioned and still not working

0

There are 0 answers