Preheat the oven to 375°F (190°C).
Lightly spray an 8x8-inch square baking pan with cooking spray or line it with parchment paper, leaving some overhang for easier removal.
Add the flour, granulated sugar, brown sugar, baking powder, cinnamon, allspice, and salt to a food processor. Pulse briefly to combine.
Add the cold cubed butter and pulse until the mixture forms small, uneven crumbs. Avoid processing it into a smooth dough.
Add the egg, lemon zest, and vanilla. Pulse just until incorporated and the crumbs hold together when gently pressed.
Divide the crumb mixture approximately in half.
Transfer one half to the prepared baking pan. Spread it evenly and gently press it into the bottom to create the crust.
In a separate bowl, combine the fresh blueberries, granulated sugar, lemon juice, and cornstarch. Toss gently until the berries are evenly coated.
Spread the blueberry mixture evenly over the prepared crust.
Scatter the remaining crumb mixture over the blueberries. Leave some variation in the size of the crumbs for a rustic topping.
Bake the Blueberry Crumb Bars for 30–40 minutes, or until the topping is lightly golden and the blueberry filling is bubbling around the edges.
Remove the pan from the oven and allow the bars to cool completely before cutting. Cooling gives the blueberry filling time to set.
Slice into squares and serve as-is or with vanilla ice cream.