In Bhagawat Gita Sri Krishna says that one who remembers the Supreme Lord and Pranava(OM) while dying reaches the higher states of bliss or the Supreme Lord Himself.
ओमित्येकाक्षरं ब्रह्म व्याहरन्मामनुस्मरन् । यः प्रयाति त्यजन्देहं स याति परमां गतिम् ।। – Shrimadbhagwadgita, Adhyaya 8, Shloka 13
Meaning-Meaning : (Shrikrushna says) The one who dies while chanting ‘Om’ and remembering me is elevated to a very high level after death.
अन्तकाले च मामेव स्मरन्मुक्त्वा कलेवरम् । यः प्रयाति स मद्भावं याति नास्त्यत्र संशयः ।। – Shrimadbhagwadgita, Adhyaya 8, Shloka 5
Meaning : (Shrikrushna says) There is no doubt that the one who remembers me while dying reaches me.
Question-Are there any other Scriptures that say by chanting Lord's name while dying one can attain moksha(liberation)?