Skip to content

NS8.1, Angular 13 - ns-router: No outlet found relative to activated route on navigating back #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
boris01 opened this issue Jan 26, 2022 · 1 comment

Comments

@boris01
Copy link

boris01 commented Jan 26, 2022

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 8.1.5
  • Cross-platform modules: 8.1.5
  • Android Runtime: 8.1.1
  • iOS Runtime: 8.1.0
  • Plugin(s): @nativescript-community/ui-material-bottomnavigationbar 6.2.5
  • NativeScript-Angular:13.0.1
  • Angular:13.1.3

Describe the bug
I get an error: "ns-router: No outlet found relative to activated route" when navigating back in nested route (one with a named outlet) .
I debug it until this function: findTopActivatedRouteNodeForOutlet in
https://github.com/NativeScript/angular/blob/main/packages/angular/src/lib/legacy/router/page-router-outlet-utils.ts

It appears that latest changes to this function affect this functionality.

export function findTopActivatedRouteNodeForOutlet(activatedRoute: ActivatedRouteSnapshot): ActivatedRouteSnapshot {
  // TODO: test this and figure it out if it's really no longer needed
  return activatedRoute;
  // let outletActivatedRoute = activatedRoute;

  // while (outletActivatedRoute.parent && outletActivatedRoute.parent.routeConfig && !outletActivatedRoute.parent.routeConfig.component) {
  //   outletActivatedRoute = outletActivatedRoute.parent;
  // }

  // return outletActivatedRoute;
}

When reverting this change back (uncomment) it is working, but reloading the whole frame.

@boris01
Copy link
Author

boris01 commented Jan 30, 2022

Closing as it duplicate of #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant