Topic: if a add a module with routing module, ng serve will fail

linziyan free asked 5 years ago


regens:

  1. blank 7.5project.
  2. add a blank routing module.
  3. add a blank test module
  4. add route to routing module, as follows:

const routes: Routes = [ { path: 'test', loadChildren: './test/test.module#TestModule' }, ];

ng serve will fail.

these are errors: assets/scss/bootstrap/bootstrap.scss✖ 「wdm」: Error: No module factory available for dependency type: ContextElementDependency


linziyan free answered 5 years ago


npm uninstall --save-dev webpack and then run a "npm install --save-dev @angular-devkit/build-angular@latest". will solve it

record in case someone needs it


linziyan free answered 5 years ago


change version to 7.4.4 ,it solves the problem.


Arkadiusz Idzikowski staff answered 5 years ago


Please send a demo of this blank project to a.idzikowski@mdbootstrap.com, that will help me to spot the problem.

Also please take a look at those issues and try the solutions provided there. It may be a problem with angular-cli/webpack:

  1. https://github.com/angular/angular-cli/issues/6417

  2. https://github.com/angular/angular-cli/issues/13298

  3. https://github.com/angular/angular-cli/issues/9680



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.5.0
  • Device: pc
  • Browser: firefox
  • OS: max
  • Provided sample code: No
  • Provided link: No