Error:No component factory found for

ionic generate page SomePage
import to another page : import { SomePage } from “./some-page”;
navigate to this page with: navCtrl.push(SomePage); //Error:No component factory found for SomePage
but navCtrl.push(‘SomePage’) works

And the problem you need help with is what exactly?

I don’t want to use the “hard code” , and also don’t want to add all pages in app.module’s entryComponents

Yeah, I was wrestling this on an app I am converting to use Lazy Loading and I kept getting this error going from my LoginPage to the HomePage, I eventually found that this error will also occur when you forget to remove the import SomePage and continue to use push(SomePage) somewhere in the app.

So in this case, the solution is simple, add the module for the page, and remove any old imports for the page, and use push(“SomePage”) where needed.

In other words the error will occur if you have accidentally left in some old code that doesn’t use the lazy loading syntax for a page that has been updated to use a local module and lazy loading.