I can not debug a server-side TypeScript application with Node.js.

Answered

I am struggling to debug a server-side TypeScript application with Node.js. I have followed the instructions provided here.

But the problem is that IntelliJ is ignoring the breakpoints I set up in my TypeScript code. However, it does recognise the ones I have set up in the JavaScript code.

I use the command "tsc" for compiling TypeScript code into JavaScript code. But I also tried to use the TypeScript widget on the Status bar with no luck.

For further information, here is my "Run/Debug configuration":

I also tried with WebStorm and I have exactly the same problem.

0
5 comments

I also tried the "Attach to Node.js/Chrome" approach, as specified there.

So I run my app using a npm configuration with the "--inspect" Node option in debug mode:

Then I also run a "Attach to Node.js/Chrome" configuration in debug mode too:

But unfortunately the problem is exactly the same.

The breakpoints I set up in my TypeScript code are simply ignored, when the one I have set up in the JavaScript code are recognised.

0

This should work if the sourcemaps are there. what does your tsconfig.json look like?

1

Thank you for the suggestion, indeed this was the problem!

I was not using sourcemaps. So I was able to fix the issue by adding the sourceMap option to my tsconfig.json file.

Thanks!

0

Great, thanks for letting me know!

0

Daniel Ochrimenko Please share the detailed problem description within a support ticket.

0

Please sign in to leave a comment.