single-spa / single-spa-angular

Helpers for building single-spa applications which use Angular
Apache License 2.0
198 stars 78 forks source link

Nested routes don't work with BrowserAnimationsModule #60

Closed joeldenning closed 4 years ago

joeldenning commented 5 years ago

This issue was first reported as a comment to a separate issue. https://github.com/CanopyTax/single-spa/issues/289#issuecomment-483105297

It is from @jaspreet1234567

Hi @joeldenning , I checked the above code looks that it resolve routing issue if we redirect one app to another app. But my issue is related to internal routing in one app.

Suppose we have two routes in "app2", and we are using "BrowserAnimationsModule" in "app2", then internal routing is not working properly because here application is not unmounted only routing is happening is one application.

I think if we are able to resolve this issue then our second issue (datepicker position) should also be resolved.

Here is the link of sample project ( https://github.com/jaspreet1234567/single-spa-internal-routing-issue ) I am using for internal routing test. I just did some modifications in your "coexisting-angular-microfrontends" application.

To reproduce the issue, just go to app 2 and trying back/forward within sub routes using browser buttons.

It is working fine in angular application if we don't use single-spa library.

jaspreet1234567 commented 5 years ago

Hi,

Any update on this?

joeldenning commented 5 years ago

Hi @jaspreet1234567, I am working on https://github.com/CanopyTax/single-spa-angular/issues/44 and https://github.com/CanopyTax/single-spa-angular/issues/41 first before shifting attention to this bug.

joeldenning commented 5 years ago

oops accidentally closed. Reopening now

HemTech commented 4 years ago

I am getting the similar issue when same name module existing in two different apps with lazylaod (with BrowserAnimationsModule)

image

Try to navigate from app1 to app2 having the same module with lazyloading.

SunilManthenaG01 commented 4 years ago

When I have two different apps both where lazy loaded and using BrowserAnimationsModule and while navigating between each other have same module names errors the above errors for me as well.

dalopezarco commented 4 years ago

Same error here.

When I navigate to a nested route and came back to a previous page, the change detection doesn't work, I have to manually put a detectChanges().

I'm using also Angular material and BrowserAnimationsModule and when I came back from another route I'm not able to use, for example, the datepicker. Things appear after a click event, but never automatically.

arturovt commented 4 years ago

@jaspreet1234567 I cloned your repo and the issue really presents there. But the issue disappeared when I upgraded single-spa-angular to 3.0.0.

@HemTech @SunilManthenaG01 @danyjaen gentlemen, your issues are impossible to test and resolve unless you provide minimal reproducible examples.

joeldenning commented 4 years ago

Thanks @arturovt - I'm closing this issue as fixed in single-spa-angular@3. If that turns out not to be true, please provide a minimal reproducible example.