New hubs don't come with a harness though.
They only have 2in of wire and a plug, so how would installing a new bearing fix a wiring issue that may come from a section of wire under the car??
You can buy a splice in wire harness from a parts store or just make your own. I'd peel back the plastic wire protector and see if you can find a broken wire or a spot is very poor condition.