Since upgrading from Angular 13 to Angular 14, I've encountered an issue with angular routing. The error message I'm receiving is:
*Uncaught Error: Uncaught (in promise): Error: NG04014: Invalid configuration of route 'homepage/'. One of the following must be provided: component, loadComponent, redirectTo, children or loadChildren*
In my App.routing.ts file, I have the following routes defined:
export const routes: Routes = [
{ path: '', redirectTo: 'homepage', pathMatch: 'full'},
{
path: 'homepage',
loadChildren: () =>
import('src/app/homepage/homepage-component/homepage.module').then(m => m.HomepageModule),
canActivate: [AuthGuard]
},
{
path: 'sales',
loadChildren: () =>
import('src/app/reports/sales-component/sales.module').then(m => m.HomepageModule),
canActivate: [AuthGuard]
},
I've attempted to add components and load components to the routes as suggested by the error message, but using loadChildren doesn't seem to work as expected. Could it be that I am misusing the loadChildren property?