I get this error when I try to compile Ahead of Time in a project written in angular 2.
Error: Error at /xxx/app/src/bootstrap.aot.ts:2:36: Can not find module '../../ app-aot / app / src / app.module.ngfactory'.
This is my bootstrap.aot file:
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"skipLibCheck": true,
"typeRoots": [
"node_modules/@types/"
]
},
"files": [
"app/src/app.module.ts",
"app/src/bootstrap.aot.ts"
],
"angularCompilerOptions": {
"genDir": "app-aot",
"skipMetadataEmit" : true
}
}
And this is my bootstrap configuration:
import { platformBrowser } from '@angular/platform-browser';
import { AppModuleNgFactory } from '../../app-aot/app/src/app.module.ngfactory';
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
The path of app.module.ngfactory
is correct, for some reason the compiler does not generate the ngfactories of the app folder. I only see in the app-aot folder the ones related to the node_modules folder, I do not know what I can be doing wrong.
Has anyone encountered a similar problem?