I know it's been asked here before but no solution fixed it for me. I've added this module to an existing project:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { DashboardComponent } from '../BackOffice/components/dashboard.component';
const routes: Routes = [
{
path: '',
component: DashboardComponent,
pathMatch: 'full'
}];
@NgModule({
imports: [
CommonModule,
RouterModule.forChild(routes)
],
declarations: [DashboardComponent]
})
export class LazyModule { }
app.module:
{ path: 'lazy', loadChildren: 'app/lazy/lazy.module#LazyModule' },
Since then, "npm start" stuck on 70%:
If I remove the module, it builds fine. This is Angular 4 btw. Thanks
You are trying to fetch lazy module from the directory named lazy.
I took a look at your directory structure here. But I didn't find any directory named 'lazy'.
Where does your LazyModule class reside?
If it is in some other directory then you can do something as below in your AppModule
{ path: 'lazy', loadChildren: './<your-deirectory-name>/lazy.module#LazyModule' },
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