Add the raspberries to a saucepan and cook over medium heat.
Add the granulated sugar and stir until combined.
Add the lemon juice and mix well.
Add the vanilla extract and stir to combine.
Mash the raspberries until they break down and release their juices.
Mix the cornstarch with water to make a smooth slurry, then add it to the raspberry mixture and stir continuously until thickened.
Turn off the heat and allow the raspberry filling to cool completely.
Transfer the filling to a bowl and it is ready to use or serve.