-
Notifications
You must be signed in to change notification settings - Fork 26.1k
unable to create a redirect for named outlet #33783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
After updating to Angular 14, I got this error for our router configuration. It seems that this was possible all the way from Angular 9 to 13, but no longer for 14: we had to replace this with: (note that the default redirect for the 'admin' panel moved from the children to the outer (main) redirect). this works nearly as well (for us), since we're never directly navigating to /all, but always to (empty), so the default redirect will also redirect the 'admin' outlet correctly. However if a user manually navigates to the /admin/all route without outlet, this will now no longer correctly set the 'admin' outlet to 'general'... |
|
Any progress with this issue? |
|
I also discovered this issue a few days ago after upgrading. Since there was no activity I decided to create a pull request on this. ( Hopefully gets in soon 🤞 |
fix(router): fix redirectTo on named outlets - resolves angular#33783
|
Very nice, thanks. Will try this once I have time :| ;) |
…angular#47927) fix(router): fix redirectTo on named outlets - resolves angular#33783 PR Close angular#47927
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@angular/animations](https://github.com/angular/angular) | dependencies | patch | [`14.2.9` -> `14.2.10`](https://renovatebot.com/diffs/npm/@angular%2fanimations/14.2.9/14.2.10) | | [@angular/common](https://github.com/angular/angular) | dependencies | patch | [`14.2.9` -> `14.2.10`](https://renovatebot.com/diffs/npm/@angular%2fcommon/14.2.9/14.2.10) | | [@angular/compiler](https://github.com/angular/angular) | dependencies | patch | [`14.2.9` -> `14.2.10`](https://renovatebot.com/diffs/npm/@angular%2fcompiler/14.2.9/14.2.10) | | [@angular/compiler-cli](https://github.com/angular/angular/tree/main/packages/compiler-cli) ([source](https://github.com/angular/angular)) | devDependencies | patch | [`14.2.9` -> `14.2.10`](https://renovatebot.com/diffs/npm/@angular%2fcompiler-cli/14.2.9/14.2.10) | | [@angular/core](https://github.com/angular/angular) | dependencies | patch | [`14.2.9` -> `14.2.10`](https://renovatebot.com/diffs/npm/@angular%2fcore/14.2.9/14.2.10) | | [@angular/forms](https://github.com/angular/angular) | dependencies | patch | [`14.2.9` -> `14.2.10`](https://renovatebot.com/diffs/npm/@angular%2fforms/14.2.9/14.2.10) | | [@angular/platform-browser](https://github.com/angular/angular) | dependencies | patch | [`14.2.9` -> `14.2.10`](https://renovatebot.com/diffs/npm/@angular%2fplatform-browser/14.2.9/14.2.10) | | [@angular/platform-browser-dynamic](https://github.com/angular/angular) | dependencies | patch | [`14.2.9` -> `14.2.10`](https://renovatebot.com/diffs/npm/@angular%2fplatform-browser-dynamic/14.2.9/14.2.10) | | [zone.js](https://github.com/angular/angular) ([changelog](https://github.com/angular/angular/blob/master/packages/zone.js/CHANGELOG.md)) | dependencies | minor | [`0.11.8` -> `0.12.0`](https://renovatebot.com/diffs/npm/zone.js/0.11.8/0.12.0) | --- ### Release Notes <details> <summary>angular/angular (@​angular/animations)</summary> ### [`v14.2.10`](https://github.com/angular/angular/blob/HEAD/CHANGELOG.md#​14210-2022-11-09) [Compare Source](angular/angular@14.2.9...14.2.10) ##### core | Commit | Type | Description | | -- | -- | -- | | [a4312e1be5](angular/angular@a4312e1) | fix | add` zone.js ` version `0.12.x` as a valid peer dependency ([#​48002](angular/angular#48002)) | ##### router | Commit | Type | Description | | -- | -- | -- | | [db867fee77](angular/angular@db867fe) | fix | fix redirectTo on named outlets - resolves [#​33783](angular/angular#33783) ([#​47927](angular/angular#47927)) | #### Special Thanks Alan Agius, Albert Szekely, Andrew Scott, Doug Parker, Kristiyan Kostadinov, Markus Eckstein, Peter Scriven and abergquist <!-- CHANGELOG SPLIT MARKER --> </details> <details> <summary>angular/angular (zone.js)</summary> ### [`v0.12.0`](https://github.com/angular/angular/blob/HEAD/packages/zone.js/CHANGELOG.md#​0120-httpsgithubcomangularangularcomparezonejs-0118zonejs-0120-2022-10-27) [Compare Source](angular/angular@zone.js-0.11.8...zone.js-0.12.0) ##### Bug Fixes - **zone.js:** cancel tasks only when they are scheduled or running ([#​46435](angular/angular#46435)) ([b618b5a](angular/angular@b618b5a)), closes [#​45711](angular/angular#45711) - **zone.js:** Fix ConsoleTask interface typo ([#​47090](angular/angular#47090)) ([91954cf](angular/angular@91954cf)) #### [0.11.8](angular/angular@zone.js-0.11.7...zone.js-0.11.8) (2022-08-08) ##### Features - **zone.js:** Update to the simpler Async Stack Tagging v2 API ([#​46958](angular/angular#46958)) ([f23232f](angular/angular@f23232f)) #### [0.11.7](angular/angular@zone.js-0.11.6...zone.js-0.11.7) (2022-07-20) ##### Bug Fixes - **zone.js:** do not invoke jasmine done callback multiple times with `waitForAsync` ([4e77c7fbf38](angular/angular@4e77c7f)) ##### Features - **zone.js:** add AsyncStackTaggingZoneSpec implementation ([#​46693](angular/angular#46693)) ([848a009](angular/angular@848a009)) - **zone.js:** include jasmine `describe` block name when raising unexpected task error ([de86285](angular/angular@de86285)) - **zone.js:** include zone name when sync-test zone reports tasks ([72c2567](angular/angular@72c2567)) #### [0.11.6](angular/angular@zone.js-0.11.5...zone.js-0.11.6) (2022-06-02) ##### Bug Fixes - **zone.js:** check if `process` is defined when patching the `GlobalErrors.install` ([#​45392](angular/angular#45392)) ([c7bcc1b](angular/angular@c7bcc1b)), closes [#​42260](angular/angular#42260) - **zone.js:** in TaskTrackingZoneSpec track a periodic task until it is cancelled ([#​45391](angular/angular#45391)) ([f19b36f](angular/angular@f19b36f)) - **zone.js:** read `Symbol.species` safely ([#​45369](angular/angular#45369)) ([e2eaac3](angular/angular@e2eaac3)) - **zone.js:** should ignore multiple resolve call ([#​45283](angular/angular#45283)) ([aebf165](angular/angular@aebf165)), closes [#​44913](angular/angular#44913) - **zone.js:** swallow the error when the element callback is not patchable ([#​45400](angular/angular#45400)) ([4ea70e3](angular/angular@4ea70e3)), closes [lwc/engine-core/src/framework/base-bridge-element.ts#L180-L186](https://github.com/lwc/engine-core/src/framework/base-bridge-element.ts/issues/L180-L186) [#​42546](angular/angular#42546) ##### BREAKING CHANGES - **zone.js:** in TaskTrackingZoneSpec track a periodic task until it is cancelled The breaking change is scoped only to the plugin `zone.js/plugins/task-tracking`. If you used `TaskTrackingZoneSpec` and checked the pending macroTasks e.g. using `(this.ngZone as any)._inner ._parent._properties.TaskTrackingZone.getTasksFor('macroTask')`, then its behavior slightly changed for periodic macrotasks. For example, previously the `setInterval` macrotask was no longer tracked after its callback was executed for the first time. Now it's tracked until the task is explicitly cancelled, e.g with `clearInterval(id)`. #### [0.11.5](angular/angular@zone.js-0.11.4...zone.js-0.11.5) (2022-03-03) ##### Bug Fixes - **zone.js:** async-test should only call done once ([#​45025](angular/angular#45025)) ([dea7234](angular/angular@dea7234)) - **zone.js:** defineProperties should also set symbol props ([#​45098](angular/angular#45098)) ([b437d12](angular/angular@b437d12)), closes [#​44095](angular/angular#44095) - **zone.js:** fix several test cases which trigger `done()` multiple times ([#​45025](angular/angular#45025)) ([d5565cc](angular/angular@d5565cc)) - **zone.js:** only one listener should also re-throw an error correctly ([#​41868](angular/angular#41868)) ([299f92c](angular/angular@299f92c)), closes [#​41867](angular/angular#41867) [/github.com/angular/angular/pull/41562#issuecomment-822696973](https://github.com//github.com/angular/angular/pull/41562/issues/issuecomment-822696973) - **zone.js:** patch global instead of Mocha object ([#​45047](angular/angular#45047)) ([8efbdb5](angular/angular@8efbdb5)), closes [#​42834](angular/angular#42834) - **zone.js:** should continue to executue listeners when throw error ([#​41562](angular/angular#41562)) ([008eaf3](angular/angular@008eaf3)), closes [#​41522](angular/angular#41522) - **zone.js:** update several flaky cases ([#​41526](angular/angular#41526)) ([25a83eb](angular/angular@25a83eb)), closes [#​41434](angular/angular#41434) ##### Features - **zone.js:** add Promise.any() implementation ([#​45064](angular/angular#45064)) ([4d494d2](angular/angular@4d494d2)), closes [#​44393](angular/angular#44393) - **zone.js:** update electron patch to support electron/remote 14 ([#​45073](angular/angular#45073)) ([d65706a](angular/angular@d65706a)), closes [#​43346](angular/angular#43346) #### [0.11.4](angular/angular@zone.js-0.11.3...zone.js-0.11.4) (2021-02-10) ##### Bug Fixes - **zone.js:** fesm2015 bundle should also be strict module. ([#​40456](angular/angular#40456)) ([f35f7c6](angular/angular@f35f7c6)), closes [#​40215](angular/angular#40215) [#​40215](angular/angular#40215) - **zone.js:** fix typo in zone_externs ([#​40348](angular/angular#40348)) ([8116edb](angular/angular@8116edb)) - **zone.js:** patch child method that overrides an already patched method ([#​39850](angular/angular#39850)) ([82e3f54](angular/angular@82e3f54)) - **zone.js:** setTimeout patch should clean tasksByHandleId cache. ([#​40586](angular/angular#40586)) ([0652b29](angular/angular@0652b29)), closes [#​40387](angular/angular#40387) - **zone.js:** update build tooling for latest changes in rules_nodejs ([#​40710](angular/angular#40710)) ([2827845](angular/angular@2827845)) ##### Features - **zone.js:** monkey patches queueMicrotask() ([#​38904](angular/angular#38904)) ([27358eb](angular/angular@27358eb)), closes [#​38863](angular/angular#38863) #### [0.11.3](angular/angular@zone.js-0.11.2...zone.js-0.11.3) (2020-10-27) ##### Bug Fixes - **zone.js:** remove global declaration ([#​37861](angular/angular#37861)) ([90c0772](angular/angular@90c0772)), closes [#​37531](angular/angular#37531) #### [0.11.2](angular/angular@zone.js-0.11.0...zone.js-0.11.2) (2020-09-19) ##### Bug Fixes - **zone.js:** jest getRealSystemTime should return native time ([#​39127](angular/angular#39127)) ([ffc3332](angular/angular@ffc3332)) - **zone.js:** add missing types field in package.json ([#​38585](angular/angular#38585)) ([27cc56b](angular/angular@27cc56b)), closes [#​38584](angular/angular#38584) - **zone.js:** defineProperty patch should not swallow error ([#​37582](angular/angular#37582)) ([45a73dd](angular/angular@45a73dd)), closes [#​37432](angular/angular#37432) - **zone.js:** run tests in umd format ([#​37582](angular/angular#37582)) ([40096be](angular/angular@40096be)) - **zone.js:** should have better backward compatibilities ([#​38797](angular/angular#38797)) ([a33d630](angular/angular@a33d630)), closes [#​38561](angular/angular#38561) [#​38669](angular/angular#38669) - **zone.js:** should invoke xhr send task when no response error occurs ([#​38836](angular/angular#38836)) ([d92a0dd](angular/angular@d92a0dd)), closes [#​38795](angular/angular#38795) - **zone.js:** zone.js toString patch should check typeof Promise is function ([#​38350](angular/angular#38350)) ([18e474f](angular/angular@18e474f)), closes [#​38361](angular/angular#38361) ##### Features - **zone.js:** add jest fakeTimers support ([#​39016](angular/angular#39016)) ([82d54fe](angular/angular@82d54fe)), closes [#​38851](angular/angular#38851) ##### Refactor - **zone.js:** refactor(zone.js): rename several internal apis in fake async zone spec ([#​39127](angular/angular#39127)) ([8a68669](angular/angular@8a68669)) ##### Build - **zone.js:** build(zone.js): zone.js should output esm format for fesm2015 bundles ([#​39203](angular/angular#39203)) ([822b838](angular/angular@822b838)) ##### BREAKING CHANGES - **zone.js:** ZoneJS no longer swallows errors produced by `Object.defineProperty` calls. Prior to this change, ZoneJS monkey patched `Object.defineProperty` and if there is an error (such as the property is not configurable or not writable) the patched logic swallowed it and only console.log was produced. This behavior used to hide real errors, so the logic is now updated to trigger original errors (if any). One exception where the patch remains in place is `document.registerElement` (to allow smooth transition for code/polyfills that rely on old behavior in legacy browsers). If your code relies on the old behavior (where errors were not thrown before), you may need to update the logic to handle the errors that are no longer masked by ZoneJS patch. #### [0.11.1](angular/angular@zone.js-0.11.0...zone.js-0.11.1) (2020-08-19) ##### Bug Fixes - **zone.js:** zone.js package.json should not include files/directories field ([#​38528](angular/angular#38528)) ([6b662d1](angular/angular@6b662d1)), closes [#​38526](angular/angular#38526) [#​38516](angular/angular#38516) [#​38513](angular/angular#38513) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♄1�7 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [x] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yMC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjEuNCJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1632 Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…angular#47927) fix(router): fix redirectTo on named outlets - resolves angular#33783 PR Close angular#47927
🐞 bug report
Affected Package
The issue is caused by package
@angular/routerIs this a regression?
Unsure.
Description
I have a named router outlet which I want to default by redirecting the empty path to one of the named paths, e.g.
This worked when the configuration was in a lazy loaded module, however moving it to the root router configuration now fails to validate. This configuration seems like it should be valid. The only workaround I could find was to use an absolute path, e.g.
🔬 Minimal Reproduction
https://stackblitz.com/edit/angular-issue-repro2-fikqg2
🔥 Exception or Error
🌍 Your Environment
Angular Version:
Anything else relevant?
Nope.
The text was updated successfully, but these errors were encountered: