I am working on an Ionic Aungular PWA project and I am consistently getting a failed Lighthouse audit in Chrome with a 404 error saying localhost page cant be found for the path I am redirecting to as the default path (/home in this example). I have included my auto generated src/app/app-routing.module.ts file below. If I replace the redirect path to load the “home” module instead of redirecting to the home path, the audit is successful. Can anyone help explain why redirectTo is not working?
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{
path: 'home',
loadChildren: () => import('./pages/home/home.module').then( m => m.HomePageModule)
},
{
path: '',
redirectTo: 'home',
pathMatch: 'full'
},
{
path: 'create-restaurant-menu',
loadChildren: () => import('./pages/page2/page2.module').then( m => m.Page2Model)
}
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
export class AppRoutingModule { }