I was facing this exact error every time I tried to run a Nest project locally via VSCode and I didn't find anything related to it on the internet, so I'm gonna post a question and the answer I found to my specific context.
Context:
The problem was that I forgot to exclude my vitest.config.ts from tsconfig.build.json, as shown below.
It made vitest.config.ts get compiled into a vitest.config.js inside the dist folder:
Which made the extension think it should consider that file and locked it for some reason (I don't know why, to be honest).
Adding vitest.config.ts
to exclude solved my problem.