udayvunnam / xng-breadcrumb

A lightweight, configurable and reactive breadcrumbs for Angular 2+
https://udayvunnam.github.io/xng-breadcrumb
MIT License
241 stars 62 forks source link

Since 6.8.0, breadcrumb disappears on page refresh #108

Closed fgoulet closed 4 months ago

fgoulet commented 2 years ago

🐞 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

github-actions[bot] commented 2 years ago

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

udayvunnam commented 2 years ago

@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

fgoulet commented 2 years ago

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

udayvunnam commented 2 years ago

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 xng-breadcrumb@7.1.1. Do let me know if you still face this issue.

fgoulet commented 2 years ago

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.

iamjustanotherrandom commented 2 years ago

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

stale[bot] commented 2 years ago

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.

iSpid3r commented 2 years ago

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.

IlyaSurmay commented 2 years ago

same here xng-breadcrumb: 8.0.2 angular: 14.0.3

marcelbarner commented 2 years ago

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

stale[bot] commented 1 year ago

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.

HammadKhaan commented 1 year ago

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 :)

stale[bot] commented 7 months ago

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.

github-actions[bot] commented 5 months ago

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.