For the pastry, put the flour, icing sugar and cocoa powder into a large bowl and mix them together. Lightly beat the egg with the lemon juice and 2 tablespoons very cold water in a measuring jug with a fork. Set aside.
Add the butter to the flour and toss the cubes to coat them in the flour. Rub the butter into the flour, using your fingertips. (Lift your hands above the bowl, rubbing the fat and flour together then letting the crumbs fall back into the bowl. Keep going until the mixture looks like fine breadcrumbs.) Make a well in the centre of the mixture and pour in the egg mixture. Incorporate the liquid into the flour and butter mixture, using one hand. Avoid overworking the dough as this will make your pastry tough. If it is too dry, add a splash more cold water.
When the dough just sticks together in clumps, form it into a ball. Knead it very lightly on a lightly floured surface to bring it together into a smooth dough. Again, don’t overwork it. You can test it by taking a little bit of pastry and rolling it out. If it starts to crack easily, it needs just a touch more kneading to develop the gluten slightly more. Wrap the pastry in cling film and leave it in the fridge to chill for about 30 minutes.
Preheat the oven to 190C/170C Fan/Gas 5. Heat a heavy, flat baking tray.
Roll the pastry out on a floured surface and use it to line a 25cm/10in fluted flan tin. Leave any excess overhanging and prick the base of the pastry using a fork. Chill the pastry for 10 minutes.
Line the pastry case with parchment paper and fill with ceramic baking beans or uncooked rice. Place the tin on the hot baking tray and bake blind for about 15 minutes until set and pale golden-brown. Remove the beans and paper and return to the oven for about 10-12 minutes until the base is cooked. Reduce the oven temperature to 180C/160C Fan/Gas 4.
For the filling, melt the chocolate and the butter together in a heatproof bowl over a pan of simmering water. When melted, set aside to cool slightly.
In a medium saucepan, combine the sugar and golden syrup and bring to the boil, stirring constantly. Set aside to cool.
Beat the eggs in a large bowl, then stir in the chocolate mixture. Whisk in the sugar syrup mixture and thoroughly combine. (It’s important to cool the melted chocolate and sugar syrup or they will scramble the eggs.) Add the vanilla extract and stir in the pecans.
Pour the pecan filling into the baked pastry and bake in the oven for 30-40 minutes until set. Cool and serve with vanilla ice cream or double cream.