Title: fix(router): lazy loaded empty root path loads with auxiliary outlet by attilavegh · Pull Request #25483 · angular/angular · GitHub
Open Graph Title: fix(router): lazy loaded empty root path loads with auxiliary outlet by attilavegh · Pull Request #25483 · angular/angular
X Title: fix(router): lazy loaded empty root path loads with auxiliary outlet by attilavegh · Pull Request #25483 · angular/angular
Description: Initial page load with secondary outlet and lazy loaded root with empty path '/(aux:path)' causes error, because the empty root path is not matched and '_loadedConfig' is undefined. This works fine if the root path is not empty or the root is not a lazy loaded module. PR Checklist Please check if your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type What kind of change does this PR introduce? [x] 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? 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() returns with noMatch(). 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: N/A What is the new behavior? The above mentioned issue is fixed in this pull request, the config is properly loaded and the outlet can be used as an entry point. Does this PR introduce a breaking change? [ ] Yes [x] No Other information
Open Graph Description: Initial page load with secondary outlet and lazy loaded root with empty path '/(aux:path)' causes error, because the empty root path is not matched and '_loadedConfig' is undefined....
X Description: Initial page load with secondary outlet and lazy loaded root with empty path '/(aux:path)' causes error, because the empty root path is not matched and '_loadedConfig...
Opengraph URL: https://github.com/angular/angular/pull/25483
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:d7a3cc96-0747-8eaf-65da-1ffc1e6ed339 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A7E2:31E99C:D45043:11CCD4B:6B010079 |
| html-safe-nonce | 54fbc967c2cfa3b649726967a4bab51c5bc3f4e15f5fa55f90bcd6a9a5f27492 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0UyOjMxRTk5QzpENDUwNDM6MTFDQ0Q0Qjo2QjAxMDA3OSIsInZpc2l0b3JfaWQiOiI0MjIwNDg1MzA2Mzg3ODU3NTI5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 421d25a807f692d08993c9e060536fd993dec923492fdfbf2968ac0a6e22380b |
| hovercard-subject-tag | pull_request:208355558 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angular/pull/25483/files |
| twitter:image | https://avatars.githubusercontent.com/u/16187465?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/16187465?s=400&v=4 |
| og:image:alt | Initial page load with secondary outlet and lazy loaded root with empty path '/(aux:path)' causes error, because the empty root path is not matched and '_loadedConfig' is undefined.... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width