Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route is overridden with base href in Location #34466

Open
kirill-chirkov-at-clouty opened this issue Dec 18, 2019 · 1 comment
Open

Route is overridden with base href in Location #34466

kirill-chirkov-at-clouty opened this issue Dec 18, 2019 · 1 comment
Labels
Milestone

Comments

@kirill-chirkov-at-clouty

馃悶 bug report

Affected Package

The issue is caused by package @angular/common

Is this a regression?

No

Description

I have next structure in my project:

  • APP_BASE_HREF provided globally as value /a/
  • Defined route /article

When entering /article page, I expect to get redirect to /a/article, but instead Location "helps" Router to get to /a/rticle, thus getting route not found error.

馃敩 Minimal Reproduction

https://stackblitz.com/edit/angular-issue-repro2-bhrjmo

馃敟 Exception or Error


ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'rticle'
Error: Cannot match any routes. URL Segment: 'rticle'
    at ApplyRedirects.noMatchError (apply_redirects.ts:110)
    at CatchSubscriber.eval [as selector] (apply_redirects.ts:87)
    at CatchSubscriber.error (catchError.ts:119)
    at MapSubscriber.Subscriber._error (Subscriber.ts:145)
    at MapSubscriber.Subscriber.error (Subscriber.ts:115)
    at MapSubscriber.Subscriber._error (Subscriber.ts:145)
    at MapSubscriber.Subscriber.error (Subscriber.ts:115)
    at MapSubscriber.Subscriber._error (Subscriber.ts:145)
    at MapSubscriber.Subscriber.error (Subscriber.ts:115)
    at TapSubscriber._error (tap.ts:126)
    at resolvePromise (zone.js:814)
    at resolvePromise (zone.js:771)
    at eval (zone.js:873)
    at ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (ng_zone.ts:262)
    at ZoneDelegate.invokeTask (zone.js:420)
    at Zone.runTask (zone.js:188)
    at drainMicroTaskQueue (zone.js:595)

馃實 Your Environment

Angular Version:




Angular CLI: 8.3.20
Node: 13.1.0
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

Package                                    Version
--------------------------------------------------------------------
@angular-devkit/architect                  0.803.20
@angular-devkit/build-angular              0.803.20
@angular-devkit/build-optimizer            0.803.20
@angular-devkit/build-webpack              0.803.20
@angular-devkit/core                       8.3.20
@angular-devkit/schematics                 8.3.20
@angular/cdk                               8.2.3
@angular/cli                               8.3.20
@angular/pwa                               0.803.20
@ngtools/webpack                           8.3.20
@nguniversal/express-engine                8.1.1
@nguniversal/module-map-ngfactory-loader   8.1.1
@schematics/angular                        8.3.20
@schematics/update                         0.803.20
rxjs                                       6.5.3
typescript                                 3.5.3
webpack                                    4.41.2

Anything else relevant?
It would be great to have Location service overridable so I can add some custom normalize logic, but I'm unable to do so since base href field inside Location is private

@iamcco
Copy link

iamcco commented Jul 29, 2020

Same here, any update?

@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed severity3: broken labels Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants