i had a similar issue without ionic but with a upgrade to angular 19. it was a outdated .browerlistrc. after removing the file. the production build worked without provider errors :) hope it helps