Adding BrowserAnimationsModule to microfrontend application causes content duplication.

This issue has been tracked since 2022-09-21.

Which @angular/* package(s) are the source of the bug?

platform-browser

Is this a regression?

No

Description

When adding BrowserAnimationsModule to an application running within microfrontend architecture (created with module federation) the content of application initially gets duplicated instead of redirecting to a different url. Similar things happens to components like a datepicker - after changing between a couple of months, the days don't get removed and end up being piled up on top of each another ( picture enclosed below).

image

When removing the BrowserAnimationsModule these errors don't appear. When running as a standalone project - without the shell/host application these errors also don't appear.
The issue was previously reported here: #38968 but was closed as the issue was allegedly resolved in version13, however I have tested it both for version 13 and 14 without success.

I have tried adding angular animations as an eager singleton to webpack.config of shell and microfrontend application like so : "@angular/platform-browser/animations": { singleton: true, strictVersion: false, requiredVersion: 'auto', eager: true }, which was proposed here: https://stackoverflow.com/questions/67386392/angular-module-federation-browsermodule.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 14.2.3
Node: 16.15.1
Package Manager: npm 8.11.0
OS: win32 x64

Angular: 14.2.2
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, material, platform-browser
... platform-browser-dynamic, platform-server, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.3
@angular-devkit/build-angular   14.2.3
@angular-devkit/core            14.2.3
@angular-devkit/schematics      14.2.3
@angular/cli                    14.2.3
@schematics/angular             14.2.3
ng-packagr                      14.2.1
rxjs                            6.6.7
typescript                      4.8.3
webpack                         5.74.0

Anything else?

No response

JoostK wrote this answer on 2022-09-21

Module Federation is not something that Angular provides out-of-the-box, so I'm afraid this is more of a support request than a bug report, and therefore more suitable for StackOverflow.

If you have additional pointers that this is a bug in Angular, please open a new issue with a minimal reproduction, as without a repro we won't be able to investigate.

More Details About Repo
Owner Name angular
Repo Name angular
Full Name angular/angular
Language TypeScript
Created Date 2014-09-18
Updated Date 2022-10-05
Star Count 84147
Watcher Count 3063
Fork Count 22247
Issue Count 1201

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date