After trying many of the things mentioned above, what worked for me was updating the WSL extension in VScode.