I am facing an issue when I try to build my app using the following command :
ionic cordova run android --prod --release
Everything runs fine if
This could also be a filename casing problem. see https://github.com/angular/angular-cli/issues/10732
elaborating on answer by @[Thom Kiesewetter]
It could also be a path casing issue reference used in the module or in routes or anywhere else
e.g path was
import { EmployeeComponent } from "./Entities/employee.component";
instead of
import { EmployeeComponent } from "./entities/employee.component";
where the real path was "entities" and not "Entities"
Changed declarations to pages like below and it worked.
declarations: pages
I got the answer at :https://forum.ionicframework.com/t/error-while-running-the-ionic3-app-in-production-mode/106294
I had the same problem , but for me, two components with the same name were there something like below,
my-first-app\src\app\header\header.component.ts
my-first-app\src\header\header.component.ts
the second one is unused and wrongly placed as all my codes were inside my-first-app\src\app only. I removed the second one and it resolved my issue.