Preheat your oven to 350°F (175°C). Grease and flour a 9x13-inch baking pan or line it with parchment paper for easy removal.
In a medium bowl, whisk together the all-purpose flour, baking soda, baking powder, salt, shredded coconut, and chopped pecans.
In a large bowl, use an electric mixer to beat the softened unsalted butter and granulated sugar together until light and fluffy.
Add the eggs one at a time, beating well after each addition. Then stir in the vanilla extract.
Alternately add the dry ingredient mixture and milk to the butter mixture, starting and ending with the dry ingredients. Mix gently until just combined.
Gently fold in the drained crushed pineapple.
Pour the batter into your prepared pan and spread evenly. Bake for 40–45 minutes or until a toothpick inserted into the center comes out clean.
Allow the cake to cool in the pan for about 15 minutes, then transfer it to a wire rack to cool completely before slicing and serving.