I have this random issue with ionic build or ionic run.
ionic build
ionic run
I\'ve noticed that during compilation it uses the cache of my source code, therefor
To complement the solution by @Renesaensz, in ionic 4.5.0 (or greater version) add cordova to the commands:
then ionic