We know one end of the wire goes to the fan, where is the wire attached at the other end? Disconnect it there then the roofers can remove the fan safely.
The wiring for the fan runs through an on/off box located on the rafter and then down to a common receptacle box.