It’s not a foregone conclusion civilians will die. For example, none were killed last month when the US drone struck the PMF militias. I will be upset by and do not condone any civilian getting killed. No matter what happens, it will be the result of Pro-Iranian militias killing US forces when they had no need to.
USA is a country in North America, they are the one who station soldiers in another continent for no reason and continue to work with groups in the region to ensure instability. They should expect to be attacked.
Here an example where USA and Iran worked together against ISIS
"The battle of Makhmour represented another important milestone in the war against ISIS: It was the place where two foreign military interventions began. One was directed by the U.S.-led international coalition, which provided air support and later, heavy weaponry. The other, in the form of ammunition, training, and intelligence support, came from Iran. Over the course of a few short days that August, coalition airstrikes hit ISIS positions in the parched desert hills near Makhmour, leveling the playing field between the heavily armed extremists and the Kurdish fighters."