I'm new to TypeScript. On a Mac I'm using WebStorm 2016.2.4 for Node with TypeScript 2.0.
Interactive debugging works fine using generated maps, but runtime stack trace links point to JavaScript files, not original TypeScript files.
Is this normal and expected? Is there a WebStorm feature I'm missing that can translate those links to the original TypeScript file and line or is this just something TypeScript developers must suffer with?
Debugging abilityWebStorm ships with great support for TypeScript, so you get the support from the start without installing any extensions to the core app. This also extends itself to integration for WebPack configuration files and packages. json , helping any development workflow.
I get stack traces using the TypeScript source file line numbers by requiring module source-map-support/register
. This can be done a number of ways, e,.g. on the node command line with --require source-map-support/register
, or you can require it in your main program. For unit testing, I have it in my mocha.opts
file:
--require source-map-support/register
--recursive
Another approach is using the ts-node
package
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With