The story of Yehudah and Tamar occurred after the family of Yaacov went to Egypt but prior to the slavery that began when Levi died 97 years after going to Egypt.
Yehudah went back and forth to Canaan after Yaacov went to Egypt, in order to continue the family business in Canaan and possibly eventually close down the business. This would allow many years for the story of family development from Yehudah and Tamar.
Where are allusions to this concept?
1) Yaacov had amassed a tremendous family wealth in Canaan which could not be shut down/sold off quickly. He had houses in Hebron that housed his entire families. He owned land in Shechem for grazing. He had inherited the tremendous wealth promised to Yitzchak, and the gifts from Avimelech. Plus, he also inherited the valuable wells of water in Beer Sheva. Yaacov would not have left all this wealth unattended. Yehudah was the one broker that both Yaacov and Yosef could trust.
2) יוֹסֵף, לְהוֹרֹת לְפָנָיו, גֹשְנָה -יְהוּדָה שָלַח לְפָנָיו, אֶל-וְאֶת “and Yehudah he (Yaacov) sent before himself to Yosef to direct him to Goshen” (46,28) The word ואת is not needed, but indicates a connection to another verse, a linking word. Where is another pasuk to connect Yehudah? “Yehudah went down (separate) from his brothers” (38,1), linking the concept that Chapter 38 occurred after the family’s going to Egypt.
3) “And he (Yosef) took a part of his brothers, he took five men and presented them to Paroh” (47,2). Which five brothers did he take? What was so important about these five? Rashi relates in the beginning of Chapter 37, that Yosef brought an evil report about the sons of Leah that they scorned the sons of Bilhah and Zilpah (calling them slaves). Thus, these six sons separated themselves from the sons of Yaacov. However, Yosef only brought five to Paroh since Yehudah had already returned to Canaan.
How does this option account for the children of Yehudah being in the count of 70 that went down to Egypt?
“And these are the names of the children of Yaacov הבאים to Egypt” (46,8), This word can be past tense (they came) or can indicate present/future tense (are coming). Thus, the verse can indicate the count are those that have come from Canaan to Egypt over a period of time, not necessarily all at the same time. The family of Yehudah came at a later time.
