When you switch on the light brake light does not come on but if you switch it off hit the brakes it comes on?

with the park lights on both left and right side are lite. but when the brake is applied the right brake lights up and the left goes out(doesn't light up)