Preheat the oven to 350°F (175°C). Grease a 9-inch cake pan and line the bottom with parchment paper.
In a large mixing bowl, measure and whisk together the flour, cocoa powder, baking soda, salt, and sugar until evenly combined.
1 1/2 cups all-purpose flour
In a separate bowl, mash the ripe avocados until smooth and creamy, then add the eggs, oil, and vanilla extract. Mix well with a spatula or mixer until fully integrated.
1 1/2 cups all-purpose flour
Pour the wet avocado mixture into the dry ingredients and fold gently with a spatula until just combined, ensuring that no dry pockets remain.
1 1/2 cups all-purpose flour
Fold in chocolate chips if using, then pour the batter into the prepared pan, spreading it evenly with a spatula.
1 1/2 cups all-purpose flour
Bake in the preheated oven for approximately 30 minutes, or until a toothpick inserted in the center comes out with a few moist crumbs. The edges should be slightly risen and set.
Remove the cake from the oven and let it cool in the pan for 10 minutes. Then transfer to a cooling rack and cool completely before frosting or serving.