My first vote would be a poor ground somewhere in the directional circuit, either under the dash (where I would look first) or out at one or more of the lights. If NOTHING is working, then it's probably somewhere under the dash. If you get one or both lights on one side to light but not blink, then it may be a poor ground.
My second vote, considering that you say they work until you turn on the headlights (thus pulling your overall voltage down, slightly) would be a corroded contact somewhere in the +12V line leading to the directionals. Start with the fuse for the directionals and make sure the contacts are clean, then work your way along the circuit, cleaning connections as you go; at the flasher, press-on tab connections, in-line connections, anything you find. There should be several connections for wires coming from your directional switch, exiting the steering column at the base of the dash. You might also check the connection of the big buss wire feeding your fuse panel to make sure it's clean and tight.
Try all that and report back. P.S. the directionals are on a reasonably simple circuit, but can be sensitive to low voltage and poor grounds and then it gets to be a PITA to find the gremlins.
gn et al