Topic: Angular 5, ng test report the error "...node_modules/ng-mdb-pro/index.ts is not part of the compilation output..."
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?
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/
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.
What worked for me was delete node_modules run npm install and then ng_build Hope it helps you too
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Specification of the issue
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No