Sitelet https://github.com/angular/angular/pull/32526
Skip to content

fix(router): lazy loaded empty root path loads with auxiliary outlet - #32526

Closed
asvishnyakov wants to merge 10 commits into
angular:masterfrom
asvishnyakov:master
Closed

asvishnyakov wants to merge 10 commits into
angular:masterfrom
asvishnyakov:master

Conversation

@asvishnyakov

@asvishnyakov asvishnyakov commented Sep 7, 2019 •

Copy link
Copy Markdown

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

This is correct implementation and replacement of #25483

Given the following route configuration:

[
    {path: '', loadChildren: 'children'},
    {path: 'a', loadChildren: 'otherChildren', outlet: 'aux'}
]

With this configuration, using the outlet as an entry point to the application, the root module will not load properly and results in the following error:

TypeError: Cannot read property 'routes' of undefined at getChildConfig (router.js:3041)

The _loadedConfig property of the route remains undefined as the expandSegmentAgainstRoute() isn't executed.

This issue is only present if the root has a lazy loaded module, works fine with a component or even with a lazy loaded module if the root path is not empty.

Issue Number: #12842

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@asvishnyakov
asvishnyakov requested a review from a team September 7, 2019 04:02
@googlebot

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

馃摑 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

鈩癸笍 Googlers: Go here for more info.

@asvishnyakov

Copy link
Copy Markdown
Author

@googlebot I signed it!

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

鈩癸笍 Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Sep 7, 2019
@ngbot ngbot Bot added this to the needsTriage milestone Sep 10, 2019
@asvishnyakov

asvishnyakov commented Sep 10, 2019 •

Copy link
Copy Markdown
Author

This PR isn't really fixing the problem, so I'm closing it. If I'll find correct solution I'll reopen it.

@angular-automatic-lock-bot

Copy link
Copy Markdown

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.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants