Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Npm start stuck at 70% affer adding "lazy" module

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%: npm start

If I remove the module, it builds fine. This is Angular 4 btw. Thanks

like image 959
Aa Yy Avatar asked Aug 06 '18 07:08

Aa Yy


1 Answers

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' },
like image 96
Kalpesh Shingala Avatar answered Oct 18 '22 21:10

Kalpesh Shingala