Preheat oven to 350°. Bake pecans and coconut in a single layer in a shallow pan 8 to 10 minutes or until toasted and fragrant, stirring halfway through.
Meanwhile, add the egg yolks, coconut milk, coconut sugar in a saucepan and mix well. Then, put the saucepan on the stovetop over low-medium heat and whisk continuously for 5 minutes.
Raise the heat to medium and then add the butter and vanilla.
Cook for 15-20 minutes, stirring constantly, until the mixture has thickened. It should coat the back of a spoon.
Turn off the heat and stir in the coconut and the pecans. Allow the frosting to cool on the counter or in the fridge. Once cool, spread the frosting on top of the cupcakes.