BrowserAnimationsModule doesn't work with Module Federation
Ricky24595422 opened this issue · 1 comments
I am working on a module-federation prototype with webpack5 and nrwl12(monorepo).
Basically, I have a host application, that loads a shared module from page b. That shared module should be used in the host then. It sets up a RouterModule.forChild() and is exposed via webpack. That works.
Now I added one of our components, which uses animation inside and things are breaking. With the BrowserAnimationsModule imported in my shared module, the host app will not work anymore. The router will just add a new copy of my shared content underneath one another every time I navigate to it. I assume it creates a new platform everytime it loads the module, but how can I prevent that?
I have also tried to share the @angular/platform-browser/animations across app and host, but without luck.
use forRoot for root module and expose child module as remote module, the issue is gone.