Pls provide details on TypeScript debugging (sourcemaps)

I am trying to make debugging of TypeScript files in a nodejs project work in WebStorm.

The only scenario where I ever got a breakpoint inside a TypeScript file to work was in a small test setup:
I had a node runtime config pointing to the TypeScript (.ts) file.

I was kind of surprised that I could pass the file path with a .ts extension to node. I was under the impression that node is not aware of source maps, so is WebStorm replacing the .ts path with a .js file extension before passing it to nodejs!?

My real problem is that I want to debug my TypeScript unit tests which are launched by a JS-only framework (e.g. mocha).

While it is no problem to debug the compiled JavaScript files of my unit tests, I was never successful in debugging the original TypeScript files.

How does sourcemap support work in the WebStorm debugger?

Shouldn't any JS file be scanned for the sourcemap comment at the end of the file (e.g. //@ and activate this feature?

Btw, I rearranged my project setup to work around a WebStorm bug with relative paths in source maps - so that is not the problem here.


1 comment
Comment actions Permalink


What is the status of debugging the original TypeScript source in nodejs projects? Is that supposed to work? Do others have that working?



Please sign in to leave a comment.