I am totally not an expert, but a few weeks ago my 7 month old ate foam from his crate pad and had loose stool. We had to put him on the bland diet, which worked, but he did vomit some bile the one day. I was worried but then googled it and found that sometimes dogs vomit bile from hunger, which made sense for me because not only was he on bland but the first meal i gave him wasnt much. he was fine after adding in his regular food.
Is your dog going awhile without any food? I hope it is as simple for you as it was for us.