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

喜你入骨 提交于 2020-01-10 10:16:04

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/15262480/how-to-debug-coffeescript-in-node-js-with-webstorm-6-source-maps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!