How do I navigate to original TypeScript file from JavaScript stacktrace in WebStorm with Node? How do I navigate to original TypeScript file from JavaScript stacktrace in WebStorm with Node? typescript typescript

How do I navigate to original TypeScript file from JavaScript stacktrace in WebStorm with Node?


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