Idoing unit turning on and off repeatedly wrx 2017

My unit has been turning on and off repeatedly while I’m driving, when I’m parked or stopped it’s completely fine. What could be the issue?