Bake the sweet potatoes: Preheat oven to 400°F. Wash and scrub the sweet potatoes, then pierce each several times with a fork. Place on a parchment-lined baking sheet and bake until tender — about 40–45 minutes for small, 50–55 for medium, or 60–70 for large. Let cool, then peel and mash.
Lower the oven: Reduce heat to 350°F.
Mix the topping: In a large bowl, combine shredded coconut, butter, flour, sugar, pecans, and vanilla. Stir well until evenly coated.
Make the filling: In another bowl, combine mashed sweet potatoes, eggs, vanilla, and melted butter. Stir to blend. Pour into a greased baking dish and spread evenly.
Add the topping: Spoon the pecan mixture over the sweet potatoes.
Bake: Place on the middle rack and bake for 20–30 minutes or until golden brown. If the topping browns too quickly, loosely cover with foil.