The box could overheat and start a fire or someone could get a shock from touching it. If the box is metal then attach the fixture ground wire to the box.
Electrical Basics Wiring A Basic Single Pole Light Switch
No ground wire in light switch box. Thread an 8 32 nut onto the screw. Disconnect your lighting circuit at the main service panel. Going without a ground wire if the light switch has a screw for a bare ground wire but your electrical box doesnt have one youre ok just leaving that screw empty and connecting your other wires to the hot screws. Connecting the ground wire to a metal electrical box will energize the box in the event of a short circuit. Wrap the wire around the screw then cinch the nut down to hold it. In many cases especially in older houses with metal boxes the metal box may be grounded even if you dont have a ground wire.
Last and least if theres no screw present in the box to connect a ground wire and no place to put a screw heres a workaround. Dont ground to the electrical box. Light fixtures and the ground wire. The house was built in 1991. Dont rely on metal sheathing or an exposed ground wire. I thought a ground wire was required by the building code.
You can add a ground wire to your electrical box in the ceiling for an extra measure of safety when replacing a ceiling light. Anyway a friend suggested i connect the ground wire on the dimmer to the metal switch box to ground it. When you have a ground wire and there is no place to attach it then place a wire connector over the end coil up the ground wire and push it back into the electrical junction box. I checked another switch. Electrical wiring in some older homes does not have a ground wire for outlets ans switches and some older homes have ground wires that are bonded behind the electrical box. If the box is not metal and a ground wire is not available in the fixture box then you can still install the key less light fixture.
I went to install a dimmer switch yesterday. Ground wires and ungrounded fixtures and boxes. Remove one of the long screws that holds the fixture in place. If your light switch spark box is made of metal its likely that the bare copper ground wire youre looking for is wrapped around the wiring cables sheath and held in place by the clamp holding. Never cut the ground wire off. Turns out the old switch didnt have a ground wire attached.