Genesis 38 10
But what he did was evil in the Lord's sight, so he also put Onan to death.
Compare with other 3 random translations
NCV Genesis 38:10The Lord was displeased by this wicked thing Onan had done, so the Lord killed Onan also.
LSV Genesis 38:10and that which he has done is evil in the eyes of YHWH, and He puts him also to death.
NKJ Genesis 38:10And the thing which he did displeased the Lord; therefore He killed him also.