Sunan an-Nasa'i, Hadith 2046 ⓘ
It was narrated from Aishah that the Prophet said: "May Allah curse people who take the graves of their prophets as Masjids."
أَخْبَرَنَا عَمْرُو بْنُ عَلِيٍّ، حَدَّثَنَا خَالِدُ بْنُ الْحَارِثِ، قَالَ حَدَّثَنَا شُعْبَةُ، عَنْ قَتَادَةَ، عَنْ سَعِيدِ بْنِ الْمُسَيَّبِ، عَنْ عَائِشَةَ، أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ " لَعَنَ اللَّهُ قَوْمًا اتَّخَذُوا قُبُورَ أَنْبِيَائِهِمْ مَسَاجِدَ " .
also referenced under: Book 21, Hadith 230 (In-Book) & Volume 3, Book 21, Hadith 2048 (DarusSalam)