Resistances and immunities are fine if they're used sensibly.
-Don't make them too frequent so that you don't have to keep swapping weapons and party members all the time.
-They should make sense in the story, whether it be due to creature's natural habitat or well-known natural ability that player has been made aware of.
-They shouldn't completely stop player's progression if he has not had the foresight to avoid selling specific weapons 20 hours ago. For example, player could be given an opportunity to acquire weapons that would work, even if they may not be amazing quality. Let's say a village is used to dealing with certain types of monsters and player could be given access to some of the weapons they've developed for village militia if he helps out with other things.
-Lastly, I'd hate to sit out my favorite party members from the big fights just because they made an early career decision to swing a warhammer rather than broadsword.
Additionally, resistance and immunity rules could be made more punishing for harder difficulty levels.