I'm not specifing lazy routing on app.module anywhere, but it throws me this error and fails to compile:
ERROR in Failed to list lazy routes: Unknown module '/Users/heikopiirme/Documents/realNewClient/client/src/app/app.module#AppModule'.
The only place I'm using lay loading is here:
{
path: 'logistics',
loadChildren: () => import('./views/logistics/logistics.module').then(m => m.LogisticsModule),
canActivate: [ AuthGuard, NgxPermissionsGuard ],
data: {
permissions: {
only: [Role.logistics_manager],
redirectTo: '/home'
}
}
}
This gave me an error but after switching to the new syntax it's fixed. How am I supposed to fix this for AppModule?
I got this error after upgrading my learning project to 8 Like op, I was surprised to get this as I am not using lazy loading.
My issue was that one of the IMPORT statements was wrong. I finally happened to notice that.
import { HeroesComponent } from './Heroes/heroes1/heroes.component';
and the error shows up
enableProdMode();
const routes: Routes = [
{ path: 'heroes', component: HeroesComponent },
If i correct the path to be (take out the 1 in the folder,heroes1--> heroes)
./Heroes/heroes/heroes.component
The error disappears and the app compiles.
This is a crazy red herring. Migrating to 8 from 7 has been rough for a variety of reasons. Hope this helps someone else.
You dont need the import(...)
, its much simpler:
...
path: 'logistics', loadChildren: './views/logistics/logistics.module#LogisticsModule'
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With