Title: Behaviour change between Angular 13 and Angular 14 · Issue #46972 · angular/angular · GitHub
Open Graph Title: Behaviour change between Angular 13 and Angular 14 · Issue #46972 · angular/angular
X Title: Behaviour change between Angular 13 and Angular 14 · Issue #46972 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description In angular 14 an exception will be thrown if a route has no component / loadComponent / redirectTo / children / loadChildren defined but ...
Open Graph Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description In angular 14 an exception will be thrown if a route has no component / loadComponent / redirectT...
X Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description In angular 14 an exception will be thrown if a route has no component / loadComponent / redirectT...
Opengraph URL: https://github.com/angular/angular/issues/46972
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Behaviour change between Angular 13 and Angular 14","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nrouter\n\n### Is this a regression?\n\nYes\n\n### Description\n\nIn angular 14 an exception will be thrown if a route has no `component` / `loadComponent ` / `redirectTo` / `children` / `loadChildren` defined but has a guard that always redirects the user in a lazy loaded route in development mode.\r\nIn angular 13 this was not the case and the user was correctly redirected after the guard was played.\r\nThis was useful for having a single guard redirecting the user on a correct child component based on some API call results for multiple pages and having a single route that only existed to redirect that would be used in other parts of the application for readability.\r\nI suppose this is due to the change causing lazy loaded route to be validated once loaded and it being considered invalid but how can I achieve the same effect without assigning a useless component to the constantly redirecting route?\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://stackblitz.com/edit/angular-ivy-gdwqjj?devToolsHeight=33&file=src/app/pages/lazy-loaded/lazy-loaded.routes.ts\n\n### Please provide the exception or error you saw\n\n```true\nError: Uncaught (in promise): Error: Invalid configuration of route 'lazy-loaded//'. One of the following must be provided: component, loadComponent, redirectTo, children or loadChildren\r\nError: Invalid configuration of route 'lazy-loaded//'. One of the following must be provided: component, loadComponent, redirectTo, children or loadChildren\n```\n\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nThe link above is the environment on stackblitz\n```\n\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/Eldriann","@type":"Person","name":"Eldriann"},"datePublished":"2022-07-26T16:19:36Z","url":"https://github.com/angular/angular/issues/46972"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c5b0a598-f1fa-57d7-b88e-1bbb7c40363e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D6A0:19AA62:C34ACF:F9907F:6B00FD76 |
| html-safe-nonce | 423d9834ae57064ce8f55a62ec04f1fc7d12252c8bf2f5c2d0e98f1c9b45445d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkEwOjE5QUE2MjpDMzRBQ0Y6Rjk5MDdGOjZCMDBGRDc2IiwidmlzaXRvcl9pZCI6IjkwODM4NDU4MjEyNjY0NjAwMjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e1592e213452df5afdbbd17251316fbfd68afcf7b807b989e4f745ff19f59c7b |
| hovercard-subject-tag | issue:1318479981 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/angular/angular/46972/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7202bfcc26ef34c29ba7c36d2a1674cfe04a3b62c247e0e2e039902a7bcab85e/angular/angular/issues/46972 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7202bfcc26ef34c29ba7c36d2a1674cfe04a3b62c247e0e2e039902a7bcab85e/angular/angular/issues/46972 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description In angular 14 an exception will be thrown if a route has no component / loadComponent / redirectT... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Eldriann |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width