This short article shows you how to debug Typescript using Visual Studio Code.
Don’t do a google search on “Debug Typescript using Visual Studio Code” because there isn’t one. After this article there maybe one.
Do the follow.
2. Build the HelloWorld as mentioned in the link to create a HelloWorld.
I actually failed to do that. So I create the js file by going to Node.js command prompt and type tsc HelloWorld.ts.
By now you should be able to run the js file without VS Code by typing node HelloWorld.js.
3. Go back to Visual Studio Code to configure the Debugger following this link https://code.visualstudio.com/docs/runtimes/nodejs.
4. Select the Debug View in the Side Bar but you might not be able to see the Configure Gear because this is some message blocking it like the one below. You need to close that message.
5. You can then click the Configure Gear and choose Node.js as mentioned in the link.
launch.json is created. You will see “program”: “$”workspaceRoot}/app.js”. Our js file is HelloWorld.js so you need to change the app.js to HelloWorld.js.