xng-breadcrumb icon indicating copy to clipboard operation
xng-breadcrumb copied to clipboard

Since 6.8.0, breadcrumb disappears on page refresh

Open fgoulet opened this issue 3 years ago • 13 comments

🐞 Bug report

Description

It was working fine by injecting BreadcrumbService in the constructor of the page until I upgraded from 6.7.0 to 6.8.0

🔬 Minimal Reproduction

Add a breadcrumb in the page, hit F5 to refresh the page.

💻Your Environment

Windows 10

Angular Version: 12.1

fgoulet avatar Dec 15 '21 13:12 fgoulet

Hello 👋 @fgoulet
Thank you for raising an issue. We will investigate into the issue and get back to you as soon as possible. Please make sure you have given us as much context as possible.
Feel free to raise a PR if you can fix the issue. Check the local development guide

github-actions[bot] avatar Dec 15 '21 13:12 github-actions[bot]

@fgoulet It worked fine with a demo app. Can you please provide a reproducible example to check the issue? Use https://stackblitz.com/edit/angular-xng-breadcrumbs as reference

udayvunnam avatar Dec 19 '21 02:12 udayvunnam

Hi @udayvunnam , I think I found why it does not work in our project. We use msal angular to handle authentication and, for some reasons, they set initialNavigation to enabledBlocking in the Router module configuration.

It was working fine until version 6.8.0. From 6.8.0 and up, if I set initialNavigation to enabledNonBlocking (the default), everything works again. But I'm not sure on the impact of this on msal angular.

Here's a repro. The breadcrumb does not appears when page load, but only when you click "change route". https://stackblitz.com/edit/angular-xng-breadcrumbs-fku85f?file=src/app/app.routing.module.ts

fgoulet avatar Dec 20 '21 16:12 fgoulet

Hi @udayvunnam , I think I found why it does not work in our project. We use msal angular to handle authentication and, for some reasons, they set initialNavigation to enabledBlocking in the Router module configuration.

It was working fine until version 6.8.0. From 6.8.0 and up, if I set initialNavigation to enabledNonBlocking (the default), everything works again. But I'm not sure on the impact of this on msal angular.

Here's a repro. The breadcrumb does not appears when page load, but only when you click "change route". stackblitz.com/edit/angular-xng-breadcrumbs-fku85f?file=src/app/app.routing.module.ts

Thanks, @fgoulet for identifying the issue. I have made a fix to this in [email protected]. Do let me know if you still face this issue.

udayvunnam avatar Jan 03 '22 05:01 udayvunnam

Hi @udayvunnam , unfortunately, the issue is still present in 7.1.1. When I set intialNavigation to enabledBlocking, I loose the breadcrumb on page refresh.

fgoulet avatar Jan 06 '22 19:01 fgoulet

Same for me, the issue is still present in latest version

iamjustanotherrandom avatar Feb 02 '22 10:02 iamjustanotherrandom

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 10 '22 18:06 stale[bot]

The issue is still relevant.

xng-breadcrumb: 8.0.2 angular: 14.0.3

The "initialNavigation" parameter is needed for Server-Side Rendering, but the breadcrumbs do not work correctly with it.

iSpid3r avatar Jun 29 '22 10:06 iSpid3r

same here xng-breadcrumb: 8.0.2 angular: 14.0.3

IlyaSurmay avatar Aug 19 '22 11:08 IlyaSurmay

I added the BreadcrumbService as constructor paramter of my AppModule and it worked. So I think the problem is that the service is initialized to late.

https://stackblitz.com/edit/angular-xng-breadcrumbs-xkivgs?file=src%2Fapp%2Fapp.routing.module.ts

xng-breadcrumb: 6.8.3 angular 12.2.16

marcelbarner avatar Aug 29 '22 03:08 marcelbarner

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 31 '22 19:12 stale[bot]

I added the BreadcrumbService as constructor paramter of my AppModule and it worked. So I think the problem is that the service is initialized to late.

https://stackblitz.com/edit/angular-xng-breadcrumbs-xkivgs?file=src%2Fapp%2Fapp.routing.module.ts

xng-breadcrumb: 6.8.3 angular 12.2.16

This works perfectly fine for me. Thanks :)

HammadKhaan avatar Aug 03 '23 09:08 HammadKhaan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 13 '24 11:03 stale[bot]