Nazareth is not mentioned in Matthew's account until Jesus' family returns from Egypt after the death of Herod I. They plan to settle in Judea, but Joseph is worried that Herod's successor-son may still be on the lookout for Jesus:
So he got up, took the child and his mother and went to the land of Israel. But when he heard that Archelaus was reigning in Judea in place of his father Herod, he was afraid to go there. Having been warned in a dream, he withdrew to the district of Galilee, and he went and lived in a town called Nazareth. (Mt. 2:21-23)
If one were to read Matthew's account without knowing Luke's version, one would have to conclude that the holy family's hometown was Bethlehem and they only moved to Nazareth years later, because they were afraid of persecution by Herod's son. Moreover, in Luke, there is no mention of the flight to Egypt, and the family seems to return to Nazareth within about 40 days of Jesus' birth.
When Joseph and Mary had done everything required by the Law of the Lord, they returned to Galilee to their own town of Nazareth. (Lk: 2:39)
The question is: "Was Matthew unaware that Jesus' family came from Nazareth to Bethlehem?" (Mt. 1-2 vs Lk: 1) Answers may also explain why Luke seems to show the family returning the Nazareth sooner than Matthew does.
Note: I have been asked to explain how this question differs from a similar one. An important difference is that the other question presumes that the two accounts are incompatible. My question asks whether Matthew was unaware of the family's residence in Nazareth prior to Jesus' birth.