ויחי יעקב בארץ מצרים שבע עשרה שנה, ויהי ימי יעקב שני חייו שבע שנים וארבעים ומאת שנה
(בראשית מ"ז, כ"ח)
Parashat VaYechi is a "parasha setuma", a closed paragraph, meaning there is no gap in the Torah scroll between the end of the previous parasha, VaYigash, and the beginning of our parasha, which opens with the words:
And Jacob lived in the land of Egypt seventeen years; so the days of Jacob, the years of his life, were a hundred forty and seven years.
(Bereshit 47, 28)
In Hebrew, setuma means shut or unknown, and Rashi offers two explanations for VaYechi being a "parasha setuma". With the death of Ya'akov, the eyes and hearts of the people of Israel were "shut", and they didn't know that the Egyptians would soon enslave them. A second explanation is that Ya'akov, on his deathbed, wished to tell his sons what the future holds for them but God "shut" the future from him and blocked him from revealing the "end of days".
The death of Ya'akov marks the birth of the people of Israel, the moment a family turns into a nation. It is only natural for Ya'akov to want to tell his sons what the future holds, to prepare them for this journey. Such knowledge would have strengthened them in the hard times ahead, knowing that despite the hardships they will face in Egypt, redemption will come and they will be saved and taken to Israel.
But knowing the divine plan also has negative aspects. A person who knows what happens at the end is exempt from planning his life or thinking about his actions based on his interpretation of reality. Knowing for certain that the current situation is going to change is dangerous, as it might make us ignore the day-to-day life and lead us to immoral deeds in the name of the future redemption. The people of Israel might have given up all hope of trying to shape their destiny, relying instead on the prophecy of Ya'akov that redemption will arrive.
Rambam makes this point very clear in Hilkhot Melakhim. He states categorically that nobody knows what the future will bring and what life would be like in the days of the Mashiach. He urges us to spend very little time on the stories about the "end of days" and the coming of the Mashiach, and he quotes the Talmud to curse those who busy themselves trying to figure out when Mashiach will come. The sages teach us that redemption is a tricky matter, now you see it - now you don't, just like a deer running in the forest. We have nothing but our eyes and our brains to guide us in the world and we should not waste time trying to figure out the endgame.
A vivid illustration of this appears in our parasha. Yossef's brothers are afraid that he will punish them for having sold him away in his youth, but Yossef tells his brothers not to fear. He tells them that despite them having done harm to him, God turned it to good and he is now in a position to save his people. He teaches them that all their calculations were turned upside down because man cannot forecast the future and God's plan is what matters.
Knowing the future is a great source of light. But when one is exposed to a powerful light source, one is also blinded. God, in His mercy, stopped Ya'akov from revealing the great light of the future to his sons in order not to blind them, in order to enable them to lead meaningful lives by making their own decisions, dreaming their own dreams and having their own hopes for the future.