Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
227 views
in Technique[技术] by (71.8m points)

visual studio code - vscode debugging typescript leads to JS files

I'm trying to debug a service I wrote in typescript with vscode. Up until now, I did not have any issues debugging, when I ran the debugger, it would debug via the typescript files.

But now when I run the service and debug, it takes me to the javascript compiled files, which makes debugging practically impossible.

This is the debugging configuration I use:

{
   "type": "node",
   "request": "launch",
   "name": "Launch Program",
   "program": "${workspaceFolder}/main.ts",
   "preLaunchTask": "tsc: build - tsconfig.json",
   "outFiles": ["${workspaceFolder}/dist/**/*.js"],
   "cwd": "${workspaceRoot}",
   "protocol": "inspector",
   "internalConsoleOptions": "openOnSessionStart"
}

I also tried running without preLaunchTask & outFiles but the result is the same.

Please advise on how can I properly debug the code.

question from:https://stackoverflow.com/questions/66046806/vscode-debugging-typescript-leads-to-js-files

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...