Diskdrive Diskdrive - 1 year ago 128
CoffeeScript Question

How can I debug CoffeeScript in my Meteor app using the WebStorm IDE

I'm able to get Meteor debugging in WebStorm using JavaScript using the instructions in this question (How can I debug my Meteor app using the WebStorm IDE?).

However, I cannot seem to set breakpoints in coffeescript files.

Is it possible to do this?

Answer Source

I fiddled with this for a while without any great success. From what I could gather, for WebStorm to support coffeescript breakpoints it needs to generate the transpiled js and map files itself... which will break meteor, as it does its own coffeescript compilation.

In the end, the closest I got was to:

  1. Run meteor with the node debugger options:

    $ NODE_OPTIONS="--debug=47977" meteor

  2. Setup a node.js remote debug configuration in Webstorm, pointing it at the same port (47977).

  3. Launch a debug session

  4. Set my breakpoints in the transpiled js files shown in the debugger's "scripts" tab. Confusingly, when setting breakpoints on these files, my version of WebStorm (8.0.4) did not show the usual red circle icon in the gutter... but it did set the breakpoint and break there.

So not ideal, but still better than nothing and more convenient than using node-inspector!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download