The fire department found Harper, 75, unconscious Wednesday night at her show Nice Work If You Can Get It in Ogunquit, Maine, according to Entertainment Tonight.
ET reports that the musical's artistic director told the audience she was sick and could not continue.
"Valerie Harper was taken to a local hospital as a precaution before her July 29 evening performance of Nice Work If You Can Get It, at the Ogunquit Playhouse, after reporting that she was not feeling well," Branford T. Kenney, the playhouse's executive artistic director, said in a statement. "She is resting comfortably and will remain in the hospital for observation for the time being. .... The audiences and all of us here at the Playhouse are greatly enjoying our time with Valerie here in Ogunquit, and we are encouraged that she is feeling better."
Harper, best known for her work on The Mary Tyler Moore Show, beat lung cancer in 2009 but revealed in 2013 she is battling terminal brain cancer.
"When I wake up in the morning I don't say, 'Oh, I have cancer.' I say 'Another day. How you feeling? Good? Good,' " she told PEOPLE in May. "And when I do have little twinges of something, I go, 'Oh my god, is that a headache? What is that?' And I say wait a day or two, it might just be a headache and usually it is … so far."
She is scheduled to play Millicent in Nice Work If You Can Get It through Aug. 15, according to Playbill.com.
In May, she also told PEOPLE that she has made peace with her diagnosis.
"I'm ready. I'm ready to go. Maybe that's the secret. That I'm absolutely – I don't want to, my God, I want to live to be 102," she said. "But I am not banking on anything, really, because we shouldn't. We don't know what's around the corner. I think you just take each day and get the best out of it and do what you can and have fun."