Al-Kāfi - Volume 1 > The Case of those who would Die without having an Imam from the Imams of Guidance
Hadith #3

3ـ أَحْمَدُ بْنُ إِدْرِيسَ عَنْ مُحَمَّدِ بْنِ عَبْدِ الْجَبَّارِ عَنْ صَفْوَانَ عَنِ الْفُضَيْلِ عَنِ الْحَارِثِ بْنِ الْمُغِيرَةِ قَالَ قُلْتُ لابِي عَبْدِ الله (عَلَيْهِ السَّلام) قَالَ رَسُولُ الله (صَلَّى اللهُ عَلَيْهِ وَآلِه) مَنْ مَاتَ لا يَعْرِفُ إِمَامَهُ مَاتَ مِيتَةً جَاهِلِيَّةً قَالَ نَعَمْ قُلْتُ جَاهِلِيَّةً جَهْلاءَ أَوْ جَاهِلِيَّةً لا يَعْرِفُ إِمَامَهُ قَالَ جَاهِلِيَّةَ كُفْرٍ وَنِفَاقٍ وَضَلالٍ.

3. Ahmad ibn Idris has narrated from Muhammad ibn ‘Abd al-Jabbar from Safwan from al-Fudayl from al-Harith ibn al-Mughira who has said the following. “I said to abu ‘Abdallah (a.s.) , ‘the Messenger of Allah has said, “Whoever would die without knowing who his Imam is he would die as if has died in ignorance (of religion).” The Imam (a.s.) said, “That is true.” I then said, “Is it the ignorance of uneducated people or ignorance of ones not knowing his Imam?” The Imam (a.s.) said, “It means the ignorance that is disbelief, hypocrisy and error?”