How to debug Node.js / JavaScript code created using CoffeeScript?

I am using CoffeeScript with Node.js. I want to be able to debug JavaScript errors / exceptions that appear, but the line numbers for these errors refer to the generated JavaScript code and not to the CoffeeScript source, so it’s hard for me to figure out where the CoffeeScript error actually is.

Is there any way to debug this? I have the latest version of Node.js, version 0.10 .

+4
source share
1 answer

The CoffeeScript compiler supports source maps , so there is a mapping from JavaScript to Coffeescript with the information you need to know. For your server project, I think Jet Brains uses this card for debugging . On the browser side, Chrome seems to support it . I'm not sure if one of the tools works for you, but if I don't think CoffeeScript and the source map are the words you should look for. Good luck

+2
source

Source: https://habr.com/ru/post/1482778/


All Articles