Preheat your oven to 350°F (175°C).
Place the pie crust in a pie dish and prick the bottom with a fork. Bake the crust according to the package instructions and let it cool.
In a saucepan, whisk together the sugar, cornstarch, and salt. Gradually whisk in the milk until the mixture is smooth.
Cook over medium heat, stirring constantly, until the mixture thickens and comes to a boil.
In a separate bowl, whisk the egg yolks. Gradually whisk in about 1 cup of the hot milk mixture to temper the eggs.
Pour the egg mixture back into the saucepan and cook for 2 minutes, stirring constantly.
Remove the saucepan from the heat and stir in the chopped chocolate and vanilla extract until the chocolate is melted and the filling is smooth.
Pour the chocolate filling into the baked pie crust and smooth the top.
Place a piece of plastic wrap directly on the surface of the filling to prevent a skin from forming. Chill the pie in the refrigerator for at least 4 hours, or until set.
Once the pie is set, top with whipped cream before serving.
Enjoy