I just updated my angular app from 13 to 14. After updating it to 14, my lazy-loading routing is not working.
I am getting bunch of error like that:

My rougint module is look like that:
const routes: Routes = [
{
path: '',
component: LayoutComponent,
canActivate: [AuthGuard],
children: [
{
path: '',
redirectTo: '/dashboard/home',
pathMatch: 'full',
},
{
path: 'dashboard',
loadChildren: (): Promise<DashboardModule> =>
import('../dashboard/dashboard.module').then(m => m.DashboardModule),
},
],
},
{ path: '**', redirectTo: '/dashboard' },
];
@NgModule({
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
exports: [RouterModule],
})
export class LayoutRoutingModule { }
Why I am having this error and what could be the soltution please?