Build failure - angular-bootstrap-md index.ts is not part of


Topic: Build failure - angular-bootstrap-md index.ts is not part of the compilation output

fmorriso asked 7 years ago

ERROR in ./node_modules/angular-bootstrap-md/index.ts Module build failed: Error: C:projectsangular-examplenode_modulesangular-bootstrap-mdindex.ts is not part of the compilation output. Please check the other error messages for details. at AngularCompilerPlugin.getCompiledFile (C:projectsangular-examplenode_modules@ngtoolswebpacksrcangular_compiler_plugin.js:629:23) at plugin.done.then (C:projectsangular-examplenode_modules@ngtoolswebpacksrcloader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) @ ./src/app/app.module.ts 9:0-58 @ ./src/main.ts @ multi ./src/main.ts My build command is: ng build --progress --verbose --vendor-chunk --extract-css

Dawid Adach pro answered 7 years ago

Dear fmorriso, This a CLI issue : https://github.com/angular/angular-cli/issues/8284   There are 2 workarounds available:
"include": [ "**/*.ts", "../node_modules/angular-bootstrap-md/index.ts" ],
or
ng serve --prod
    More explanation here: https://github.com/mdbootstrap/Angular-Bootstrap-with-Material-Design/issues/23

fmorriso answered 7 years ago

Short-term, these seem to work:
ng build --progress --verbose --vendor-chunk --extract-css --prod --aot
or
ng serve --open --verbose --vendor-chunk --extract-css --prod --aot

The "include" a bunch of extra files technique is too burdensome - too many places to find and fix.  I gave up trying to use that alternative after putting the following in two different places (tsconfig.json and tsconfig.app.json) and still seeing a bunch of "not part of..." errors:
"include":[
"**/*.ts",
"../node_modules/angular-bootstrap-md/index.ts",
"../node_modules/angular-bootstrap-md/ripple/*.ts"
]

In one of the references that you cite, I see the following from @filipesilva that basically points the finger at the way angular-bootstrap-md is packaged within node_modules as the root cause of the issue:

You have TS files in your node_modules. This really goes against how libraries should be packaged: libraries should never ship their source .ts files.

So, will you (meaning angular-bootstrap-md) be re-thinking the way you package up and install via npm at some point in the future?


Cameron Owen pro premium priority answered 7 years ago

I'm having the same problem but with the following error:
ERROR in ./node_modules/ng-mdb-pro/index.ts Module build failed: Error: C:SAPHIProjectsprueandcamnode_modulesng-mdb-proindex.ts is not part of the compilation output. Please check the other error messages for d etails. at AngularCompilerPlugin.getCompiledFile (C:SAPHIProjectsprueandcamnode_modules@ngtoolswebpacksrcangular_compiler_plugin.js:629:23) at plugin.done.then (C:SAPHIProjectsprueandcamnode_modules@ngtoolswebpacksrcloader.js:467:39) at process._tickCallback (internal/process/next_tick.js:109:7) @ ./src/app/app.module.ts 20:0-49 21:0-50 @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
I tried adding the following line to tsconfig.app.json: "include": [ "**/*.ts", "../node_modules/ng-mdb-pro/index.ts" ] I now get this warning:
WARNING in ./node_modules/ng-mdb-pro/node_modules/@angular/core/@angular/core.es5.js 5659:15-36 Critical dependency: the request of a dependency is an expression at ImportLazyContextDependency.getWarnings (C:SAPHIProjectsprueandcamnode_moduleswebpacklibdependenciesContextDependency.js:39:18) at Compilation.reportDependencyErrorsAndWarnings (C:SAPHIProjectsprueandcamnode_moduleswebpacklibCompilation.js:703:24) at Compilation.finish (C:SAPHIProjectsprueandcamnode_moduleswebpacklibCompilation.js:561:9) at applyPluginsParallel.err (C:SAPHIProjectsprueandcamnode_moduleswebpacklibCompiler.js:506:17) at C:SAPHIProjectsprueandcamnode_modulestapablelibTapable.js:289:11 at _addModuleChain (C:SAPHIProjectsprueandcamnode_moduleswebpacklibCompilation.js:507:11) at processModuleDependencies.err (C:SAPHIProjectsprueandcamnode_moduleswebpacklibCompilation.js:477:14) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9) @ ./node_modules/ng-mdb-pro/node_modules/@angular/core/@angular/core.es5.js @ ./node_modules/ng-mdb-pro/mdb.module.ts @ ./node_modules/ng-mdb-pro/index.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts WARNING in ./node_modules/ng-mdb-pro/node_modules/@angular/core/@angular/core.es5.js 5675:15-102 Critical dependency: the request of a dependency is an expression at ImportLazyContextDependency.getWarnings (C:SAPHIProjectsprueandcamnode_moduleswebpacklibdependenciesContextDependency.js:39:18) at Compilation.reportDependencyErrorsAndWarnings (C:SAPHIProjectsprueandcamnode_moduleswebpacklibCompilation.js:703:24) at Compilation.finish (C:SAPHIProjectsprueandcamnode_moduleswebpacklibCompilation.js:561:9) at applyPluginsParallel.err (C:SAPHIProjectsprueandcamnode_moduleswebpacklibCompiler.js:506:17) at C:SAPHIProjectsprueandcamnode_modulestapablelibTapable.js:289:11 at _addModuleChain (C:SAPHIProjectsprueandcamnode_moduleswebpacklibCompilation.js:507:11) at processModuleDependencies.err (C:SAPHIProjectsprueandcamnode_moduleswebpacklibCompilation.js:477:14) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9) @ ./node_modules/ng-mdb-pro/node_modules/@angular/core/@angular/core.es5.js @ ./node_modules/ng-mdb-pro/mdb.module.ts @ ./node_modules/ng-mdb-pro/index.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
And the site gives this error:
compiler.js:466 Uncaught Error: Unexpected value '[object Object]' imported by the module 'AppModule'. Please add a @NgModule annotation. at syntaxError (compiler.js:466) at eval (compiler.js:15088) at Array.forEach () at CompileMetadataResolver.getNgModuleMetadata (compiler.js:15071) at JitCompiler._loadModules (compiler.js:33486) at JitCompiler._compileModuleAndComponents (compiler.js:33447) at JitCompiler.compileModuleAsync (compiler.js:33363) at CompilerImpl.compileModuleAsync (platform-browser-dynamic.js:230) at PlatformRef.bootstrapModule (core.js:5446) at eval (main.ts:11) syntaxError @ compiler.js:466 (anonymous) @ compiler.js:15088 CompileMetadataResolver.getNgModuleMetadata @ compiler.js:15071 JitCompiler._loadModules @ compiler.js:33486 JitCompiler._compileModuleAndComponents @ compiler.js:33447 JitCompiler.compileModuleAsync @ compiler.js:33363 CompilerImpl.compileModuleAsync @ platform-browser-dynamic.js:230 PlatformRef.bootstrapModule @ core.js:5446 (anonymous) @ main.ts:11 ../../../../../src/main.ts @ main.bundle.js:60 __webpack_require__ @ inline.bundle.js:55 0 @ main.bundle.js:82 __webpack_require__ @ inline.bundle.js:55 webpackJsonpCallback @ inline.bundle.js:26 (anonymous) @ main.bundle.js:1 client:144 [WDS] Warnings while compiling. msgWarnings @ client:144 onmessage @ socket.js:38 EventTarget.dispatchEvent @ sockjs.js:170 (anonymous) @ sockjs.js:883 SockJS._transportMessage @ sockjs.js:881 EventEmitter.emit @ sockjs.js:86 WebSocketTransport.ws.onmessage @ sockjs.js:2957 wrapFn @ zone.js:1166 ZoneDelegate.invokeTask @ zone.js:425 Zone.runTask @ zone.js:192 ZoneTask.invokeTask @ zone.js:499 invokeTask @ zone.js:1540 globalZoneAwareCallback @ zone.js:1566 client:147 ./node_modules/ng-mdb-pro/node_modules/@angular/core/@angular/core.es5.js 5659:15-36 Critical dependency: the request of a dependency is an expression @ ./node_modules/ng-mdb-pro/node_modules/@angular/core/@angular/core.es5.js @ ./node_modules/ng-mdb-pro/mdb.module.ts @ ./node_modules/ng-mdb-pro/index.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts msgWarnings @ client:147 onmessage @ socket.js:38 EventTarget.dispatchEvent @ sockjs.js:170 (anonymous) @ sockjs.js:883 SockJS._transportMessage @ sockjs.js:881 EventEmitter.emit @ sockjs.js:86 WebSocketTransport.ws.onmessage @ sockjs.js:2957 wrapFn @ zone.js:1166 ZoneDelegate.invokeTask @ zone.js:425 Zone.runTask @ zone.js:192 ZoneTask.invokeTask @ zone.js:499 invokeTask @ zone.js:1540 globalZoneAwareCallback @ zone.js:1566 client:147 ./node_modules/ng-mdb-pro/node_modules/@angular/core/@angular/core.es5.js 5675:15-102 Critical dependency: the request of a dependency is an expression @ ./node_modules/ng-mdb-pro/node_modules/@angular/core/@angular/core.es5.js @ ./node_modules/ng-mdb-pro/mdb.module.ts @ ./node_modules/ng-mdb-pro/index.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

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: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No