Preheat oven to 350°F (175°C).
In a medium saucepan, melt butter over medium heat.
In a bowl, whisk sugar, flour, and cocoa powder. Slowly add to melted butter while stirring.
Gradually pour in milk, stirring constantly until smooth.
Cook mixture, stirring, for 5–7 minutes until thickened. Remove from heat.
In a small bowl, whisk egg yolks. Add a spoonful of hot filling, whisk, then return mixture to saucepan.
Cook 2–3 minutes more, stir in vanilla, then pour into pre-baked crust.
Beat egg whites and cream of tartar until soft peaks form. Gradually add sugar and beat until stiff peaks form.
Spread meringue over filling, sealing edges.
Bake for 10–12 minutes until meringue is golden brown.
Cool completely before slicing and serving.