Topic: Angular 5, ng test report the error "...node_modules/ng-mdb-pro/index.ts is not part of the compilation output..."

Chen Xiao pro asked 4 years ago


After upgraded to Angular 5, I found ng test report the error: "...node_modules/ng-mdb-pro/index.ts is not part of the compilation output..." But ng serve compiled successfully, why?

Dawid Adach pro answered 4 years ago


Dear Chen, this is one of the issues of new Angular 5, it's described here: https://github.com/angular/angular-cli/issues/8284 Due to fact that there are still few issues with Angular 5 we have created FAQ page containing common issues: https://mdbootstrap.com/angular/faq/

Chen Xiao pro answered 4 years ago


Find the answer: https://github.com/angular/angular-cli/issues/8284#issuecomment-341417325 From Angular 5, you not only need put the "include" in mdb-pro tsconfig.json: "include": [ "node_modules/ng-mdb-pro/**/*.ts", But also, you need to add the "include" to the src/tsconfig.spec.json: "include": [ "../node_modules/ng-mdb-pro/**/*.ts", Now ng test works again.

Alberto pro answered 4 years ago


What worked for me was delete node_modules run npm install and then ng_build Hope it helps you too    

Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags