When I try to build my project running the following command:
ng build --environment=prod --aot=false --output-pa
Stupid fix
Removing node_modules and installing the packages again npm i or yarn worked for me!
node_modules
npm i
yarn