Start by preheating your oven to 350°F (175°C). Lightly grease or line your baking dish with parchment paper. This ensures the cake doesn’t stick and makes removal easier after baking.
In a medium bowl, combine flour, baking powder, baking soda, salt, and cinnamon. Whisk everything together until evenly mixed. This step ensures the spices and leavening agents are distributed properly.
In another bowl, whisk together sugar, brown sugar, eggs, oil, and vanilla extract. Mix until smooth and slightly thick. This creates the base that gives the cake its moist texture.
Fold in the grated carrots and drained crushed pineapple. These ingredients add moisture and natural sweetness. Make sure everything is evenly incorporated without overmixing.
Gradually add the dry ingredients into the wet mixture. Stir gently until just combined. Avoid overmixing, as it can make the cake dense instead of soft.
In a separate bowl, beat the cream cheese until smooth. Add melted butter, powdered sugar, and vanilla extract. Mix until creamy and lump-free.
Pour the carrot cake batter into the prepared baking dish and spread evenly. Then, gently pour or spoon the cream cheese mixture on top. It will create a gooey layer as it bakes.
Place the dish in the oven and bake for 40–45 minutes. The edges should be set, but the center will remain slightly gooey. This is what gives the cake its signature texture.
Allow the cake to cool completely before slicing. This helps the layers set properly. Once cooled, cut into squares and serve.