A VCSEL device includes a polyimide having a larger thickness (d1) on the surface of a semiconductor layer structure in a peripheral area 54, which is separated from a mesapost by an annular groove 52. The top surface of the central mesapost 30 is located at a lower position compared to the top surface of the peripheral area 54. A structure is obtained wherein the mesapost is not contacted by a jig or probe during handling the device in the test or assembly thereof.