Cannot determine the module for class X in X.ts! Add X to the NgModule to fix it error in ionic2

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