Had the same issue and in my case it was a problem with a vs code extension. Try running code as:
$ code --disable-extensions
Once in the editor, I ran my program in the debug mode and worked, and then started code with
$ code
And it continued working fine.
Hope it works for you.