stackblitz / core

Online IDE powered by Visual Studio Code ⚡️
https://stackblitz.com
MIT License
10.18k stars 885 forks source link

Routing is not working #2981

Closed SreeDivyaReddy closed 4 months ago

SreeDivyaReddy commented 4 months ago

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'react/' Error: Cannot match any routes. URL Segment: 'react/' at ApplyRedirects.noMatchError (https://angular-live-compiler-mghqut.stackblitz.io/turbo_modules/@angular/router@11.0.8/__ivy_ngcc__/bundles/router.umd.js:3069:20) at CatchSubscriber.eval [as selector] (https://angular-live-compiler-mghqut.stackblitz.io/turbo_modules/@angular/router@11.0.8/__ivy_ngcc__/bundles/router.umd.js:3050:33) at CatchSubscriber.error (https://angular-live-compiler-mghqut.stackblitz.io/turbo_modules/rxjs@6.6.3/internal/operators/catchError.js:46:31) at Subscriber._error (https://angular-live-compiler-mghqut.stackblitz.io/turbo_modules/rxjs@6.6.3/internal/Subscriber.js:92:26) at Subscriber.error (https://angular-live-compiler-mghqut.stackblitz.io/turbo_modules/rxjs@6.6.3/internal/Subscriber.js:72:18) at Subscriber._error (https://angular-live-compiler-mghqut.stackblitz.io/turbo_modules/rxjs@6.6.3/internal/Subscriber.js:92:26) at Subscriber.error (https://angular-live-compiler-mghqut.stackblitz.io/turbo_modules/rxjs@6.6.3/internal/Subscriber.js:72:18) at Subscriber._error (https://angular-live-compiler-mghqut.stackblitz.io/turbo_modules/rxjs@6.6.3/internal/Subscriber.js:92:26) at Subscriber.error (https://angular-live-compiler-mghqut.stackblitz.io/turbo_modules/rxjs@6.6.3/internal/Subscriber.js:72:18) at Subscriber._error (https://angular-live-compiler-mghqut.stackblitz.io/turbo_modules/rxjs@6.6.3/internal/Subscriber.js:92:26) Made 7

SreeDivyaReddy commented 4 months ago

const routes: Routes = [ { path: 'react', component: ApplicationComponent }, { path: 'template', component: TemplateApplication }, ]; app.component.html <button (click)="navigate()">Home

app.component.ts

constructor(private router: Router) {} navigate() { this.router.navigate(['react', '']); }

github-actions[bot] commented 4 months ago

In order to investigate further we need a link to a StackBlitz project reproducing the issue.

As this issue has been inactive for 1 day without a reproduction link, it will be closed to allow prioritization of other issues. /n /n If this needs additional investigation, please share a reproduction link by opening a new issue. Thanks for your diligence in helping us continuously improve the StackBlitz platform.