Skip to content

Paths generated for child outlets relative to empty path named outlet parent are incorrect #42191

Closed

Description

@RSalo

Bug Report

Affected Package

Angular 11 and lower

Is this a regression?

Yes

Description

I have 2 outlets. Primary - for child pages. Main-page - using only to display main page template. It can not to work if outlet is root of router tree.

Minimal Reproduction

https://stackblitz.com/edit/outlet-example-veyabe
After clicking on the "Link to innerRoute" there is should to show another page. But it's not.

Exception or Error


Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'innerRoute'
Error: Cannot match any routes. URL Segment: 'innerRoute'

Your Environment

Angular Version:


angular 12 fresh install

Anything else relevant?
Are there related issues? Sorry if there are exist any.

Activity

  1. added this to the needsTriage milestone on May 20, 2021
  2. atscott commented on May 20, 2021

    @atscott
    Contributor

    @RSalo Just to clarify, this doesn't appear to be a regression. It appears to be the same behavior in all the versions I've tried.

  3. changed the title [-][Router] Outlet children[/-] [+]Paths generated for child outlets relative to empty path named outlet parent are incorrect[/+] on May 20, 2021
  4. atscott commented on May 20, 2021

    @atscott
    Contributor

    The link should really go to (main-page:innerRoute) but it's generated incorrectly.

    As a workaround, you can change the routerLink to be <a [routerLink]="[{outlets: {'main-page': 'innerRoute'}}]">Link to innerRoute</a>

  5. added
    P4A relatively minor issue that is not relevant to core functions
    on May 20, 2021
  6. modified the milestones: needsTriage, Backlog on May 20, 2021
  7. RSalo commented on May 21, 2021

    @RSalo
    Author

    @atscott your variant with workaround looks good for me but it's don't work either, causing the same exception in the console. This issue is not so critical for me so i can just change my file structure to a workaround.

  8. angular-automatic-lock-bot commented on Jun 24, 2022

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  9. locked and limited conversation to collaborators on Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions