Skip to content

Navigation error when using clearHistory: true: `ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'peekState' of undefined #2232

@bellalMohamed

Description

@bellalMohamed

Environment

  • CLI: 6.8.0
  • Cross-platform modules:
  • Android Runtime: 6.5.3
  • Plugin(s):
  • NativeScript-Angular: ~9.0.0
  • Angular: ~9.1.0

Describe the bug
Navigation stuck after navigating from a page with clearHistory: true
If we have 3 pages A, B, C when navigating from Page A to page B with clearHistory: true then trying to navigate to page C this error occurs ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'peekState' of undefined after debugging I found that it's due too not founding an outlet inside when calling the function getOutletByFrame inside ns-location-strategy.js file, so there should be a default outlet if there's no matching outlet.

To Reproduce
Create fresh Angular 9 project and create 3 pages as mentioned

Pull request attached to fix this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions