Skip to content

Preloading of nested lazy modules does not work #49558

@Eugeno

Description

@Eugeno

Which @angular/* package(s) are the source of the bug?

router

Is this a regression?

No

Description

Preload only works for siblings, not children.
For example, there is a structure:

graph LR
pages --> b
pages --> c
b --> b-review
b --> b-detail
b-detail --> b-maintenance
b-detail --> b-additional
Loading

If you go to /pages/c you'll get only b preloaded. But you could have a link on /pages/c to pages/b/detail/1/maintenance. Therefore, I want to get b-index, b-detail-index, b-detail-component, and b-maintenance preloaded.

Stackblitz: https://stackblitz.com/edit/angular-uc5bt8

Please provide a link to a minimal reproduction of the bug

https://github.com/Eugeno/a-f

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 15.2.4
Node: 16.14.0
Package Manager: npm 8.3.0
OS: win32 x64

Angular: 15.2.3
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.4
@angular-devkit/build-angular   15.2.4
@angular-devkit/core            15.2.4
@angular-devkit/schematics      15.2.4
@angular/cli                    15.2.4
@schematics/angular             15.2.4
rxjs                            7.8.0
typescript                      4.9.5

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions