Title: router: `The ActivatedRoute has an invalid structure` warning improvements · Issue #49116 · angular/angular · GitHub
Open Graph Title: router: `The ActivatedRoute has an invalid structure` warning improvements · Issue #49116 · angular/angular
X Title: router: `The ActivatedRoute has an invalid structure` warning improvements · Issue #49116 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? No Description #47988 introduced a warning in dev when the ActivatedRoute has an invalid structure This ends up generating quite a lot of noise when upda...
Open Graph Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? No Description #47988 introduced a warning in dev when the ActivatedRoute has an invalid structure This ends up g...
X Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? No Description #47988 introduced a warning in dev when the ActivatedRoute has an invalid structure This ends up g...
Opengraph URL: https://github.com/angular/angular/issues/49116
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"router: `The ActivatedRoute has an invalid structure` warning improvements","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nrouter\n\n### Is this a regression?\n\nNo\n\n### Description\n\n#47988 introduced a warning in dev when the ActivatedRoute has an invalid structure\r\n\r\nThis ends up generating quite a lot of noise when updating existing tests as the warning is outputted several times per test.\r\n\r\nFor example, consider this small repro https://stackblitz.com/edit/node-1bky4j?file=repro/src/app/home/home.component.spec.ts (run `ng test`)\r\n\r\nThe template has just a `routerLink`, and the test provides a \"fake\" ActivatedRoute (usually with params, but the point is that it's partial and thus incomplete).\r\n\r\nThis ends up generating:\r\n\r\n```\r\n✔ Browser application bundle generation complete.\r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in tests.'\r\nFirefox 109.0 (Mac OS 10.15): Executed 2 of 5 SUCCESS (0 secs / 0.03 secs)\r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in \r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in tests.'\r\nFirefox 109.0 (Mac OS 10.15): Executed 2 of 5 SUCCESS (0 secs / 0.03 secs)\r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in \r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in tests.'\r\nFirefox 109.0 (Mac OS 10.15): Executed 3 of 5 SUCCESS (0 secs / 0.045 secs)\r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in \r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in tests.'\r\nFirefox 109.0 (Mac OS 10.15): Executed 3 of 5 SUCCESS (0 secs / 0.045 secs)\r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in \r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in tests.'\r\nFirefox 109.0 (Mac OS 10.15): Executed 4 of 5 SUCCESS (0 secs / 0.05 secs)\r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in \r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in tests.'\r\nFirefox 109.0 (Mac OS 10.15): Executed 4 of 5 SUCCESS (0 secs / 0.05 secs)\r\nWARN: 'The ActivatedRoute has an invalid structure. This is likely due to an incomplete mock in \r\nFirefox 109.0 (Mac OS 10.15): Executed 5 of 5 SUCCESS (0.086 secs / 0.054 secs)\r\n```\r\n\r\nA few questions:\r\n- is the warning really necessary in that case? It's hard to understand (from the warning alone, and even after looking at #47988) in what way this is an issue\r\n- if the warning is necessary and something needs to be fixed for an upcoming change, maybe the warning could include a bit more information on how to do so? I suppose that most developers that are going to run into it will ask the same question. I'll gladly submit a PR to improve it if I get some guidance on what would need to be changed\r\n- if the warning is necessary, could it be displayed less often? because it is outputted dozens of times on some applications where I tested the RC\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://stackblitz.com/edit/node-1bky4j?file=repro/src/app\n\n### Please provide the exception or error you saw\n\n_No response_\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI: 15.2.0-rc.0\r\nNode: 16.17.0\r\nPackage Manager: yarn 1.22.17\r\nOS: darwin arm64\r\n\r\nAngular: 15.2.0-rc.0\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... localize, platform-browser, platform-browser-dynamic, router\r\n\r\nPackage Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect 0.1502.0-rc.0\r\n@angular-devkit/build-angular 15.2.0-rc.0\r\n@angular-devkit/core 15.2.0-rc.0\r\n@angular-devkit/schematics 15.2.0-rc.0\r\n@angular/cdk 15.1.4\r\n@schematics/angular 15.2.0-rc.0\r\nrxjs 7.8.0\r\ntypescript 4.8.4\n```\n\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/cexbrayat","@type":"Person","name":"cexbrayat"},"datePublished":"2023-02-16T17:21:48Z","url":"https://github.com/angular/angular/issues/49116"}
| 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:1975d5e4-a591-dcfc-a04a-0de849fb66b4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEBC:DB09F:B92B37:ED79AE:6B00FCE3 |
| html-safe-nonce | 95b52675f8573ae3e7af324dde1ee8330565a210bdf184023424ed27ee4b2a07 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUJDOkRCMDlGOkI5MkIzNzpFRDc5QUU6NkIwMEZDRTMiLCJ2aXNpdG9yX2lkIjoiMTE1MTc4NjE0NDY4MjI3ODExNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ce6ab52024f0459faa3df65ca9d9b0cde5d28d5bdfbdc1be5d61e7a9d10c5db6 |
| hovercard-subject-tag | issue:1588083283 |
| 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/49116/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c753d01b9bfc5fbac59a18d130b6a552c335cb953132d1804c98f24db9b2df49/angular/angular/issues/49116 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c753d01b9bfc5fbac59a18d130b6a552c335cb953132d1804c98f24db9b2df49/angular/angular/issues/49116 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? router Is this a regression? No Description #47988 introduced a warning in dev when the ActivatedRoute has an invalid structure This ends up g... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cexbrayat |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| 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 | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width