I had this issue, some of the fixes here worked for me until I had to do ionic build --prod. The issue reappeared then.
What worked for me was to use npm to downgrade the @angular-devkit/build-angular from 803.25 to 803.23.
Hopefully they will fix the library in future versions. Seems to be a recent issue