Preheat the oven to 425°F (220°C) and line the bottom of a 12-inch (30 cm) pie dish with parchment paper. Set aside.
Melt the butter in a medium skillet placed over medium heat. Add the shallots and cook until soft and translucent, about 1-2 minutes. Sprinkle with fresh thyme or rosemary if desired. Set aside.
Roll out the puff pastry into a large circle to fit the pie dish and prick the bottom with a fork.
Spread out the cranberry sauce over, add the shallots, then top with a layer of Brie cheese. Sprinkle with fresh cranberries and bake until cheese is melted about 25 minutes. Top with pecans, then place in the oven for 5 additional minutes. Top with fresh thyme or rosemary, slice, and serve warm!