Set an oven rack in the middle of the oven and preheat the oven to 350 degrees F. Line a rimmed quarter-sheet pan with parchment paper and rub with a light coating of butter.
Whisk together the flour, baking powder and baking soda in a medium bowl. Set aside.
In the bowl of a stand mixer fitted with the paddle attachment, beat the butter on medium-high speed until the cubes have blended together into one large smooth ball. Add the brown and granulated sugars and beat until completely combined, scraping down the sides of the bowl as needed, 1 1/2 to 2 1/2 minutes. (It should have the texture of wet sand.) Add the vanilla and eggs and beat until well combined. (There might be small pebble-size pieces of butter in the mixture, but that is okay.) Add half of the flour mixture and beat on medium-low speed until just combined. Add the remaining flour mixture and beat until the mixture just comes together. Do not overmix. Add the hazelnuts and dark chocolate chunks and mix on low speed until just combined.
Transfer the cookie dough to the prepared sheet pan and use your hands or a rubber spatula to lightly press the dough in an even layer. Bake, rotating the pan halfway through, until the edges are light golden brown and the top is dry to the touch, 15 to 18 minutes. Place the pan on a cooling rack and cool completely. It is okay if the cookie is slightly under-baked when it comes out of the oven; it will continue to cook as it cools. (These bars are best when they are nice and gooey in the middle, so it is better to err on the side of under-baking than over-baking.)
When ready to serve, preheat an outdoor grill to medium heat. Using a bench scraper or a straight-sided metal spatula, cut the cookie into 24 bars. Put the pan with the cut bars directly on the grill and cook, covered, until the chocolate is melted and the bars are warmed through, about 5 minutes. (Alternatively, the bars can be rewarmed in an oven or removed from the pan and rewarmed in a microwave.) Transfer the cookie bars to individual plates and top with a scoop of vanilla ice cream. Serve immediately.
To toast your own hazelnuts, spread them on a baking sheet in a single layer and roast at 350 degrees F until fragrant, 8 to 10 minutes. Allow to cool before lightly crushing.
Recipe courtesy of David Burtka