The Messenger of Allah ﷺ said on the day of Uhud, "O Allah, if You so will, You will not be worshipped on earth."
أن رسول الله ﷺ كان يقول يوم أحد: اللهم! إنك إن تشأ، لا تعبد في الأرض.
Muslim narrated it in the Book of Jihad and Expeditions (23:1743), from Hajjaj bin Shayr, who said, Abdul-Samad told us, Hammad told us, from Thabit, from Anas, who said, and then he mentioned it.Nawawi said, "The well-known account in the books of expeditions and battles is that he said it on the day of Badr, but this narration states that he said it on 'the day of Uhud'. There is no contradiction between the two, for he said it on both days." And Allah knows best.