How do I debug typescript code in VS 2017?

In prior versions of Visual Studio, this was not possible.

In Visual Studio 2017 however, this has been fixed. Just set your breakpoint and run your project using IE (or Chrome) and your breakpoint will be hit in your ts file and you can step through the code in the VS environment (not in the browser code debug window). This is a huge step forward for Typescript development.

The interesting things is that the code will transition to js if it jumps to another file for which there is no matching ts file, and then transition back again to ts again when it can.


Make sure you enable browser link in order to see TS break points being hit. The option is the blue arrow circle to the right of the browser selection drop-down in VS2017 and it seems to default to disabled.

enter image description here


I was attempting to convert the dotnetcore ReactRedux template to Typescript and could not get breakpoints to hit my typescript files.

I was able to determine that in your tsconfig.json file you need to have the options inlineSourceMap:true and inlineSources:true set.