Moshe Rabeinu was shown all of Eretz Yisrael before his death, right up until the border of Dan (34:1). Rashi explains that Moshe was shown the people of Dan engaged in idol worship, but was also shown the rise of Shimshon who would redeem them. Why did G-d spoil Moshe’s final moments by showing him the Jewish people’s fall to idolatry? Why could He not allow Moshe to revel in the success and hopeful future of the Jewish people without burdening him with an image of their failure?
The Shem m’Shmuel answers that these two images – the idolatry of Dan and the rise of Shimshon from Dan – are not two separate visions, but go hand in hand. Hashem revealed to Moshe that even when the Jewish people fall to greatest depths, they can give rise to a Shimshon, a shofet so great that Ya’akov Avinu saw in him the potential to be Moshiach. Moshe now knew that his death and the inevitable retreat from the glorious heights attained by the “dor de’ah” would not lead to permanent downfall.