[Machine] The Messenger of Allah ﷺ cursed those who visit graves and build mosques and lights on them. The wording of the hadith is from Shu'ba, and in their narration it is "the visitors of graves and those who build mosques and lights on them".
لَعَنَ رَسُولُ اللهِ ﷺ زَائِرَاتِ الْقُبُورِ وَالْمُتَّخِذَاتِ عَلَيْهَا الْمَسَاجِدَ وَالسُّرُجَ لَفْظُ حَدِيثِ شُعْبَةَ وَفِي رِوَايَتِهِمَا زَوَّارَاتِ الْقُبُورِ وَالْمُتَّخِذِينَ عَلَيْهَا الْمَسَاجِدَ وَالسُّرُجَ