I am trying to compile my angular code to production mode via ng build --prod and its successful but in browser I get the error :
ERROR p {_
I did not want to give up the optimization as the bundle size became about 8 times larger.
luckily it turned out to be something stupid :) I had providers:[] section in one of my components When I removed it the error has disappeared.
Hope this might be helpful for someone!