Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:43:45

And ask those We sent before you of Our messengers; have We made besides the Most Merciful deities to be worshipped?  

And ask those of Our messengers whom We sent before you: Did We ˹ever˺ appoint, besides the Compassionate One, that is to say, ˹any˺ other than Him, gods to be worshipped? It is said that this is to be understood literally, in other words, that God gathered for him all the messengers on the Night ˹of the˺ Journey; but it is also said that this meant ˹that he should ask˺ any communities belonging to either of the two Peoples of the Scripture. According to one of the two opinions, he never asked ˹anyone˺ since the point of this command to ask is to affirm to the idolaters of Quraysh that no messenger or scripture ever came from God with the command to worship ˹any˺ other than God.
القرآن:٤٣:٤٥

وَاسْأَلْ مَنْ أَرْسَلْنَا مِنْ قَبْلِكَ مِنْ رُسُلِنَا أَجَعَلْنَا مِنْ دُونِ الرَّحْمَٰنِ آلِهَةً يُعْبَدُونَ  

{واسأل من أرسلنا من قبلك من رسلنا أجعلنا من دون الرحمن} أي غيره {آلهة يعبدون} قيل هو على ظاهره بأن جمع له الرسل ليلة الإسراء، وقيل المراد أمم من أي أهل الكتابين، ولم يسأل على واحد من القولين لأن المراد من الأمر بالسؤال التقرير لمشركي قريش أنه لم يأت رسول من الله ولا كتاب بعبادة غير الله.