They try to make tawil of it. They say it means earth must have God's appointed representative. Be it Imam or Prophet or Messenger or King, etc . But I doubt whether there was any God's appointed representative before Mohammad(Pbuh).
Yes there are shia ahadith that there must be a hujja on earth.But it is mutwatir in shia ahadith that earth cannot exist without an Imam.
عن سعد بن سعد، عن أحمد بن عمر، عن أبي الحسن الرضا عليه السلام قال: قلت له هل تبقى الأرض بغير إمام؟
قال عليه السلام: لا .
قلت: فإنا نروي عن أبي عبد الله عليه السلام أنه قال: لا تبقى إلا أن يسخط الله على العباد؟
قال عليه السلام: لا تبقى... إذا لساخت . )
بصائر الدرجات : ص ٤٨٩ ب ١٢ ح ٨
I think shiat intentionally tries to downgrade Prophet (saw) and replace him with Ali,so Ali is an eternal Imam.
It has been narrated from Salman Farsi that he said to Ali : My father and mother be sacrificed over you, you are the hujjah of Allah due to whom the tawba of Adam was accepted, and due to you Joseph (Yusuf) got out of the well, and due to you Ayyub was relieved (from the trouble) and Allah showered His blessings upon him.
Tafsir Burhan, Muqaddimah, p. 27