I finally got to Number chapter 26 and read this:
בְּנֵי יְהוּדָה עֵר וְאוֹנָן וַיָּמָת עֵר וְאוֹנָן בְּאֶרֶץ כְּנָעַן׃
Born to Judah: Er and Onan. Er and Onan died in the land of Canaan.
Then I remembered that I read almost the same thing in Genesis 38:8
And Judah said to Onan: Come to your brother's wife and take her in levirate marriage, and establish seed for your brother, [the son being called by the latter's name].
How is this possible? Were they reincarnated for some reason while the Israelites were on the journey?