Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to debug coffeescript in node.js with webstorm 6 source maps

I've set up the coffeescript file watcher like in this video

http://www.youtube.com/watch?v=Sl1Uk3zT5Fg

Which seems to work fine for an html project debugging with google chrome. However, when I start debugging and set a breakpoint in the coffeescript file in a node.js project, it doesn't hit the breakpoint. Setting a breakpoint in the generated js file does however get hit.

What do I need to do for the debugger to use the generated source maps and step through the coffeescript with node.js in webstorm 6?

like image 580
MonkeyBonkey Avatar asked Mar 07 '13 03:03

MonkeyBonkey


People also ask

How do I debug Node JS WebStorm?

To start debugging, hold Ctrl+Shift and click the link. WebStorm starts a debugging session with an automatically generated Attach to Node. js/Chrome configuration.


2 Answers

The just released CoffeeScript 1.6.2 now has the annotation for the source map at the bottom as WebStorm expects so it now works as expected.

like image 54
Larry Maccherone Avatar answered Oct 17 '22 06:10

Larry Maccherone


According to the issue that CrazyCoder mentioned, it looks like it is an issue with WebStorm expecting the //@ sourceMappingURL=print.map statement at the bottom of a generated JavaScript file rather than at the top which is where the coffeescript compiler currently puts it.

Manaually copying that line to the bottom of the generated script file on every save seems not a viable workaround so I think we'll have to watch that Webstorm issue until it is resolved.

like image 34
MonkeyBonkey Avatar answered Oct 17 '22 06:10

MonkeyBonkey