I´m getting the wellknown "Error: Cannot match any routes." in angular only on my Prod machine, on my local Visual studio dev it is working just fine...
The strange thing is that I have defined path '**', but still get this error. The path to the actual page is "admin/Forms/Index/19130" where "Forms" is the root. So I have also tried path 'Forms/index/:Id' without any success.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { getParamsService } from 'ClientApp/Shared/getParamsService';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { DataService } from 'ClientApp/Shared/dataService';
import { tokenResponseService } from 'ClientApp/Shared/tokenResponseService';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { TokenInterceptorService } from 'ClientApp/Shared/token-interceptor.service';
import { ReactiveFormsModule } from '@angular/forms';
let routes = [
{ path: '**', component: AppComponent },
]
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
HttpClientModule,
AppRoutingModule,
RouterModule.forRoot(routes, { useHash: false, enableTracing: false })
],
providers: [getParamsService,
{ provide: HTTP_INTERCEPTORS, useClass: TokenInterceptorService, multi: true },
DataService,
tokenResponseService],
bootstrap: [AppComponent]
})
export class AppModule { }
this works on my dev machine
let routes = [
{ path: '', component: AppComponent },
{ path: 'Forms/Index/:id', component: AppComponent },
]
But on the prod server I get "Error: Cannot match any routes."
Any help is appreciated
Thanks in advance