Preheat the oven to 400°F (200°C). Line two baking sheets with parchment paper.
In a saucepan, combine water, butter, and salt. Bring to a boil over medium heat.
Once boiling, remove from heat and add the flour all at once. Stir vigorously until the mixture forms a ball and pulls away from the sides of the pan.
Let it cool for a few minutes, then add eggs one at a time, mixing well after each addition until the dough is smooth and glossy. Stir in the vanilla extract.
Step 2: Bake the Pastry Layers
Divide the choux pastry into two equal portions. Spread each portion onto the prepared baking sheets into a rectangle, about ½ inch thick.
Bake in the preheated oven for 25-30 minutes or until golden brown and puffed. Remove from the oven and let cool completely.
Step 3: Make the Custard Filling
In a saucepan, heat the milk and half of the sugar over medium heat until it begins to simmer.
In a separate bowl, whisk together the egg yolks, cornstarch, and remaining sugar until smooth.
Gradually pour the hot milk mixture into the egg mixture, whisking constantly to avoid curdling.
Return the mixture to the saucepan and cook over medium heat, stirring constantly, until it thickens, about 5-7 minutes.
Remove from heat and stir in the vanilla extract and butter until smooth. Let it cool completely.
Step 4: Assemble the Cake
Place one layer of choux pastry on a serving platter. Spread the cooled custard filling evenly over the top.
Carefully place the second layer of choux pastry on top of the custard.