microsoft / microsoft/vscode-js-debug
Unable to debug typescript directly
@connor4312 is already working on this.
Since Jan 9, 2026.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 373
- Avg merge
- 1d 9m
- Merged PRs (30d)
- 6
Description
Describe the bug
When I set "program" to a typescript file, the debugger tries to find the compiled output and if it manages to, overwrites the value with the found javascript file.
Relevant code is here. Apparently related issue is #291.
This is completely undocumented and unexpected. Looking at the code, there doesn't seem to be any way to disable this behavior. Even if the predictor isn't sure what the source is (it finds multiple candidates), it just picks the first one.
If I set the program to a typescript file, it's because I want to debug the typescript file. If there happens to be built output there, it's probably out of date. It's not at all obvious that the old built code is being executed instead of the fresh source.
The original assumptions no longer apply, since Node itself can run typescript. Even at the time, it was noted that other runtime possibilities exist, but the code does not check the runtime value.
To Reproduce
Steps to reproduce the behavior:
- Create a launch config with "program" set to a typescript file
- Compile the typescript file with sourcemaps
- Start debugging
- The debugger substitutes the program value with the built path instead
VS Code Version:
1.107.1 (Universal)
Commit: 994fd12f8d3a5aa16f17d42c041e5809167e845a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.