Angular CLI: 1.7.3 Node: 8.9.4 OS: win32 x64 Angular: 5.2.9 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router
@angular/cli: 1.7.3 : 0.3.2 : 0.3.2 : 0.3.2 : 1.2.0 : 1.10.2 : 0.3.2 : 0.3.2 typescript: 2.5.3 webpack: 3.11.0
We are doing lazy loading for external bundle module in our application, the external bundle is created using ng-packagr.
Source link:
External module: lazy-module Application: app-consume
Steps to reproduce the issue.
- Bundle the external module "lazy-module" using "npm run cd"
- include the bundle in "app-consume" application using “npm install dist.tgz”
- When we run or build app-consume application, using “ng serve “ or “ng build” it fails
[Note: Issue won't reproduce in "ng serve -aot" and "ng build -aot", command]
If we serve the application using development server using "ng serve" command, it fails with below error message. Error: is logged bundle.d.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property
ERROR in ./node_modules/bundle/bundle.d.ts Module build failed: Error: D:\consume\node_modules\bundle\bundle.d.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format . at AngularCompilerPlugin.getCompiledFile (D:\consume\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:674:23) at plugin.done.then (D:\consume\node_modules\@ngtools\webpack\src\loader.js:467:39) at at process._tickCallback (internal/process/next_tick.js:188:7)
Expectation: Able to run and build the app, using with help of "ng serve" and "ng build"