An inverter device includes a heat generator, a cooler, and a cooler-side housing that covers the cooler and includes an opening that exposes a side of the cooler closer to the heat generator, and a circumferential rib that comes into contact with the cooler is provided in a vicinity of a peripheral edge of the opening of the cooler-side housing.