question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Navigation ID 2 is not equal to the current navigation id 3

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/router

Is this a regression?

I never had this problem in previous version of angular.

Description

After auth login i have one button which will redirect me to dashboard but i am getting navigation is not matched. On component i have only one time router.navigate([β€˜/dashboard’]); With routerlink it is working routerLink=β€œ/dashboard”

πŸ”¬ Minimal Reproduction

Click on image to see properly. Log: image

image


https://stackblitz.com/...

πŸ”₯ Exception or Error





🌍 Your Environment

Angular Version:




ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.3.0
Node: 10.16.0
OS: win32 x64
Angular: 8.2.3
... common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.3
@angular-devkit/build-angular     0.801.3
@angular-devkit/build-optimizer   0.801.3
@angular-devkit/build-webpack     0.801.3
@angular-devkit/core              8.1.3
@angular-devkit/schematics        8.3.0
@angular/animations               8.2.5
@angular/cdk                      8.1.4
@angular/cli                      8.3.0
@angular/material                 8.1.4
@ngtools/webpack                  8.1.3
@schematics/angular               8.3.0
@schematics/update                0.803.0
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.35.2

Anything else relevant?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
atscottcommented, May 28, 2020

Duplicate of #34795 (the guard triggered a new navigation, which caused the NavigationCancel of the original and the new navigation goes to /auth/login, the URL of the start of the navigation)

1reaction
LanderBeeuwsaertcommented, Mar 22, 2020

β€œbecause your not supposed to do that in Angular” => I think I have a legitimate use-case for wanting to navigate twice in the same β€œframe/tick”. Possibly there are other solutions for solving what I want to do, if so, I have not found them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Navigation ID is not equal to the current router ...
Say the current navigation ID is 11. When I navigate to the problem route, the router starts navigation, successfully executes every navigation ......
Read more >
Angular – Navigation ID is not equal to the current router ...
I'm using @ngrx/router-store in my Angularv5 app and I recently started running into a an error: Navigation ID X is not equal to...
Read more >
When sophistication hurts functionality - i'm david
The error that we were getting when navigating was Navigation ID is not equal to the current router navigation id .
Read more >
NavigationBehaviorOptions - Angular
After a navigation completes, the router writes an object containing this value together with a navigationId to history.state . The value is written...
Read more >
[Solved]-Javascript code that show what is not equal-angular.js
[Solved]-Javascript code that show what is not equal-angular.js ... 2: NavigationCancel - Navigation ID 2 is not equal to the current navigation id...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found