The grueling heat of Arizona sent Jennifer Garner to the hospital twice while filming new movie, The Kingdom. “I guess I was getting heatstroke,” Garner, who filmed the FBI drama while breastfeeding her daughter Violet, says in the October issue of Marie Claire. “All my electrolytes were going to the baby — I wasn’t keeping any of the potassium in my body. I would never pass out or anything, but I just got so dizzy that I thought, I can’t pick up my daughter when I get back to the hotel. It happened twice. It was scary.”

The Alias alum says she didn’t expect the temperature to take such a toll on her. “I checked with a pediatrician, I checked with my gynecologist,” she assures, “and they said, ‘Breast-feeding? You’ll be fine. Just drink plenty of water.’ But the rules when it’s 138 degrees are different.”

Says Garner, “I made it through, though. I really didn’t want to give it up, and I didn’t.” She even reveal she continued to breastfeed baby Violet, now 22 months, until she was 14 months old. “I really loved it. It gave me peace and a sense of purpose.”