Search code examples
angularaotangular-aot

Differences between Angular compilations


When I compile my app with

ng build --prod

I have this error

ERROR in : Cannot determine the module for class AppComponent in D:/desarrollos/PatientPortal/front/src/app/customizations/database/app.component-database.ts! Add AppComponent to the NgModule to fix it.

but if it compile with

ng build --configuration=prod

It's compile ok and my app works ok.

I see the difference is the first one is compile with the AOT option, but I don't know why have this error, and don't know if it is important (maybe is about an extended class I have, but is important to me). Can you help me?


Solution

  • I found help In the github repository:

    https://github.com/angular/angular/issues/38070

    In my case, I'm trying to compile and abstract class using @Component decorator insteed @Directive decorator.