I have built a angular 8 library that compiles perfectly and I can pack it with npm pack command to use it in other project as a npm package. When I use that library in other project I can serve it or build it in JIT mode without a problem. The problem occurs when I do this in AOT mode.
The error that shows the aot compilation of the project is this one:
ERROR in Cannot read property 'indexOf' of null
I cannot see anything more than that. After digging more in the problem I found that the problem is inside the node_modules. This is the error path:
\node_modules@angular\compiler\bundles\compiler.umd.js
Project Versions:
- Angular CLI: 8.3.25
- Node: 10.15.3
- OS: win32 x64
- Angular: 8.2.14
@angular-devkit/architect 0.803.25
@angular-devkit/build-angular 0.803.25
@angular-devkit/build-optimizer 0.803.25
@angular-devkit/build-webpack 0.803.25
@angular-devkit/core 8.3.25
@angular-devkit/schematics 8.3.25
@angular/cdk 8.2.3
@angular/cli 8.3.25
@angular/flex-layout 8.0.0-beta.27
@angular/http 7.2.16
@angular/material 8.2.3
@angular/material-moment-adapter 8.2.3
@ngtools/webpack 8.3.25
Library Versions:
- Angular CLI: 8.3.25
- Node: 10.15.3
- OS: win32 x64
- Angular: 8.2.14
@angular-devkit/architect 0.803.25
@angular-devkit/build-angular 0.803.25
@angular-devkit/build-ng-packagr 0.803.25
@angular-devkit/build-optimizer 0.803.25
@angular-devkit/build-webpack 0.803.25
@angular-devkit/core 8.3.25
@angular-devkit/schematics 8.3.25
@angular/cli 8.3.25
@angular/http 7.2.16
@ngtools/webpack 8.3.25
@schematics/angular 8.3.25
@schematics/update 0.803.25
ng-packagr 5.7.1
The main problem is that I cannot know where the problem or error is located.
Hope you can help me! :)