manfredsteyer / module_federation_nx_mono_repo

9 stars 12 forks source link

Multiple shell in nx repo with angular module federation #6

Open gobedson opened 2 years ago

gobedson commented 2 years ago

Hello , this is not an issue but a question.

Is is possible to have two shell in a nx mono repo avec angular module federation ?

In my case i have a shell app and mfe1, mfe2 and it works fine.

Now i've created a new app shell2 for exemple in the same repo and would like to use mfe2 with shell2.

The project serve perfectly but when i try to route to mfe2 i have an error in my console :

Error: inject() must be called from an injection context at injectInjectorOnly (core.js:4764:15) at Module.ɵɵinject (core.js:4774:12) at Object.RouterModule_Factory [as factory] (router.js:6002:102) at R3Injector.hydrate (core.js:11457:35) at R3Injector.get (core.js:11276:33) at core.js:11314:55 at Set.forEach () at R3Injector._resolveInjectorDefTypes (core.js:11314:31) at new NgModuleRef$1 (core.js:25345:26) at NgModuleFactory$1.create (core.js:25399:16) at resolvePromise (zone.js:1211:1) at resolvePromise (zone.js:1165:1) at zone.js:1278:1 at _ZoneDelegate.invokeTask (zone.js:406:1) at Object.onInvokeTask (core.js:28679:33) at _ZoneDelegate.invokeTask (zone.js:405:1) at Zone.runTask (zone.js:178:1) at drainMicroTaskQueue (zone.js:585:1)

Any help or suggestion is welcome