Skip to content

Named outlets of lazy loaded modules in auxiliary routes do not work聽#26964

Closed

Description

@joshualouisjenson

馃悶 bug report

Affected Package

7.0.1

Is this a regression?

No

Description

Named routes of lazy loaded modules which are loaded as part of an auxiliary route in another lazy loaded module do not work. Empty routes work correctly.

馃敩 Minimal Reproduction

https://stackblitz.com/edit/angular-pxlnes

Note that named and unamed outlets for non-lazy loaded modules in LazyModule1 work correctly, as does the unnamed route in LazyModule2. The named route in LazyModule2, when accessed through the auxilliary route in LazyModule1 however, does not.

In the example, the problem link is the second link in the list titled "Lazy content with parameters".

馃敟 Exception or Error

errors.ts:35 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'lazy1/1/2'

馃實 Your Environment

7.0.1

I searched for other issues and found some others that are similar to this setup (such as #24562) but are not exactly the same. The workaround for that issue is also unsuitable for my use case, as I need to be able to reroute the auxiliary outlet without changing the primary route.

Thank you.

Activity

  1. added this to the needsTriage milestone on Nov 6, 2018
  2. modified the milestones: needsTriage, Backlog on Nov 13, 2018
  3. henrique-barreto commented on Dec 12, 2018

    @henrique-barreto

    Very annoying bug!!! For years, other issues about this bug were created and closed, but the problem persist.

  4. TGC79 commented on Jan 23, 2019

    @TGC79

    Duplicate of #10726 which should be reopened since the fix for it was reverted.

    Issue was first reported on Angular 2.0.0-rc.5.

  5. lincolnthree commented on Jun 6, 2019

    @lincolnthree
    Contributor

    Still having this issue in Angular 8. Having trouble finding a workaround. Looking into CDK portals but... that adds a lot of complications.

  6. superdyzio commented on Jun 24, 2019

    @superdyzio

    @joshualouisjenson I checked that stackblitz and it actually started working after changing lazy2-routes.ts:10 from path: ':paramA:paramB' to path: ':paramA/:paramB' (this is the url you are actually redirecting to in PortalComponent) 馃帀

  7. Jonathan002 commented on Jul 20, 2019

    @Jonathan002

    @joshualouisjenson I have created a package that is suppose to be a workaround for named router outlets in lazy modules. Please have a look at it and hope it helps. : )

    Repo Link: https://github.com/Jonathan002/route-master-example

  8. angular-automatic-lock-bot commented on Sep 15, 2019

    @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 Sep 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions