angular / angular

Deliver web apps with confidence 🚀
https://angular.dev
MIT License
95.66k stars 25.23k forks source link

Adding BrowserAnimationsModule to microfrontend application causes content duplication. #47514

Closed Konraadd closed 1 year ago

Konraadd commented 1 year ago

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: https://github.com/angular/angular/issues/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 commented 1 year ago

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.

angular-automatic-lock-bot[bot] commented 1 year ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.