When I was younger (sometime in elementary school), I used to worry about this (not having anyone attend my funeral).
I remember picturing the funeral ceremony at the gravesite, with no one there other than the rabbi -- who I didn’t recognize – surrounded by empty chairs. At some point in time, I stopped worrying about not having friends.