I've recently upgraded from Ionic 4 Angular 8 to Ionic 5 Angular 11. Everything runs fine in the browser (ionic build --prod
) and Android debug build (ionic cordova build android
). When I build for Android production mode (ionic cordova build android --prod
) I encounter random runtime errors such as:
this.service.method is not a function
e.service.method is not a function
These errors do not result in crashes, the app runs fine afterwards, but some functions are broken. This happens only for some services and methods called in components and pages, without any pattern that I can find. What could possibly be the cause?
Will add more detail but at the moment have no clue where to start.