Cannot match any routes. URL Segment: '%2F' after login
See original GitHub issueHi all,
after logging in, my application throws this error:
core.js:4061 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: '%2F'
Error: Cannot match any routes. URL Segment: '%2F'
at ApplyRedirects.push../node_modules/@angular/router/fesm5/router.js.ApplyRedirects.noMatchError (router.js:2471)
at CatchSubscriber.selector (router.js:2452)
at CatchSubscriber.push../node_modules/rxjs/_esm5/internal/operators/catchError.js.CatchSubscriber.error (catchError.js:34)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:79)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:59)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:79)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:59)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:79)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:59)
at ThrowIfEmptySubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:79)
at resolvePromise (zone.js:832)
at resolvePromise (zone.js:784)
at zone.js:894
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:27791)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
at drainMicroTaskQueue (zone.js:601)
at push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:507)
at ZoneTask.invoke (zone.js:492)
I already set initialNavigation to false and tried the steps proposed here:
My auth config (if this matters) looks like this, by usage of implicit flow:
authConfig: {
issuer: 'https://localhost:5001',
redirectUri: 'http://localhost:4200/',
postLogoutRedirectUri: 'http://localhost:4200/',
clientId: 'api-client',
responseType: 'id_token token',
silentRefreshRedirectUri: 'http://localhost:4200/silent-refresh.html',
showDebugInformation: false,
scope: 'openid api',
silentRefreshTimeout: 25000,
timeoutFactor: 0.75,
sessionChecksEnabled: true,
clearHashAfterLogin: false
},
My application routes are like that:
const routes: Routes = [
// { path: 'home', component: BoxesPanelComponent, canActivate: [LoginAuthGuard] },
{ path: 'login', component: LoginComponent },
{ path: '', component: BoxesPanelComponent, canActivate: [LoginAuthGuard] },
];
Do you have any hints, how I can fix that exception?
Thanks in advance,
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Error: Cannot match any routes. URL Segment: - Angular 2
Solved myself. Done some small structural changes also. Route from Component1 to Component2 is done by a single <router-outlet> .
Read more >Error: Cannot match any routes - Nishu Goel - Medium
This generally occurs when there is a mismatch in the routes specified, or a component which is not present in our routing configuration,...
Read more >Error: Cannot match any routes. URL Segment: 'tabs/groups'
I am trying to put all my tabs under auth guard and users can see those tabs after they logged in, but I...
Read more >"Cannot match any routes" Error - Auth0 Community
After successful login, the router navigates to the page iit's supposed to, but there are query parameters in the URL that I don't ......
Read more >Router tutorial: tour of heroes - Angular
A wildcard route has a path consisting of two asterisks. It matches every URL. Thus, the router selects this wildcard route if it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
I have currently a hard time, reproducing this. Can you please let me know what to do to make this issue in our sample application happen?
@manfredsteyer Could be good to merge my PR if there’s no bandwidth to do the other option. Then the action needed from users gets some more visibility.