I'm not sure if the Gen 3 & 4 are the same as the Gen 1 & 2, but on the Gen 2 this is usually the problem. The Taillight Failure Sensor.
This is what fries inside them. If you get one from a wrecking yard, check it first!!! Just insert a very small flat screwdriver into the seem and pry it open. If you see obvious signs of melted or fried stuff, it's garbage. If it's bad, it will look like this:
I was told about a way to stop them from burning out by simply jumping a fuse holder across the 2 green wires from the yellow box and put in a fuse. Haven't fried one since, yet went through 3 in the few months before I learned this trick! (Still easier to replace, but this works!)