I updated quite sizable project to angular 14.On one particular route config I get the following error when I click on a link to redirect.
Error: NG04014: Invalid configuration of route 'publication/:id/:slug/'. One of the following must be provided: component, loadComponent, redirectTo, children or loadChildren
The configuration of the routes is like so
import { Route } from '@angular/router';
export const PublicationRoutes: Route[] = [
{
path: 'publications',
loadChildren: () => import('./modules/publication-listing/publication-listing.module').then(m => m.PublicationListingModule)
},
{
path: 'publication/create',
loadChildren: () => import('./modules/publication-modify/publication-modify.module').then(m => m.PublicationModifyModule),
pathMatch: 'full'
},
{
path: 'publication/:id/edit',
loadChildren: () => import('./modules/publication-modify/publication-modify.module').then(m => m.PublicationModifyModule),
pathMatch: 'full'
},
{
path: 'publication/:id/:slug',
loadChildren: () => import('./modules/publication-view/publication-view.module').then(m => m.PublicationViewModule),
},
{
path: 'publication',
redirectTo: 'publications',
pathMatch: 'full'
}
];
The puzzling part is that there is the exact same configuration on a different route, and it works fine there. I tried to look for differences, but I find none. The error doesnt make sense because there is loadChildren. Has anyone encountered something similar?