Im implemented a module which provides an modal. Then I created an Ionic app which wants to open the modal from this module. This works in debug build, but not in prod build. There I get the error:
Error: Uncaught (in promise): Error: No component factory found for t. Did you add it to @NgModule.entryComponents?
After disabling minification, the error message was a little bit more helpful:
Error: Uncaught (in promise): Error: No component factory found for ModalCmp. Did you add it to @NgModule.entryComponents?
I stripped the error down to tree-shaking. If I disable it in package.json
:
"config": {
"ionic_manual_treeshaking": false
},
everything works fine. I assume, I have to add something somewhere to prevent the removing of ModalCmp
by tree-shaking.
But what? Any help would be appreciated.