Prep the pan and oven. Heat the oven to 350°F (175°C).
Line a 9x13-inch baking pan with parchment, leaving overhang on the long sides for easy lifting. Lightly grease the parchment.
Cook and mash the sweet potatoes. Pierce sweet potatoes and bake until tender, about 45–60 minutes at 400°F, or microwave until soft. Cool slightly, peel, and mash until smooth.
Measure out 2 cups.
Make the crust/crumble mixture. In a large bowl, whisk the flour, oats, brown sugar, granulated sugar, salt, and cinnamon. Stir in melted butter and vanilla until clumps form. Fold in pecans if using.
Reserve 1 1/2 cups of this mixture for the topping.
Press and par-bake the crust. Firmly press the remaining mixture into the lined pan in an even layer. Bake for 12–15 minutes, until set and lightly golden at the edges.
Mix the filling. In a medium bowl, whisk mashed sweet potato, brown sugar, eggs, milk, melted butter, vanilla, cinnamon, nutmeg, ginger, and salt until smooth and glossy.
Assemble. Pour the filling over the warm crust and spread evenly. Sprinkle the reserved crumble over the top, pinching some into larger clumps for texture.
Bake. Return the pan to the oven and bake 28–35 minutes, until the center is set and the topping is golden.
A toothpick should come out mostly clean with a few moist crumbs.
Cool completely. Let the bars cool in the pan on a rack for at least 1 hour, then chill for 1–2 hours for the neatest slices.
Slice and serve. Use the parchment to lift the slab out. Cut into squares. Serve as is, or add a small dollop of whipped cream or a drizzle of maple glaze.