I had two different problems that caused the same symtom.
First was a worn through vacume hose that went right down by the battery torward front fender. Just had the battery replaced months ago and the protective sheild slid down and away from the batt. Took two months to wear through.
Second one drove me nuts. The mechanic had replaced both spark pack all wires, the plugs were new. I was bleeding the coolant over the water pump and a spark like hell hit. Turns out the plug had a cracked procelain. Replaced it and instant relief.