Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 442
Diskdrive Avatar asked Oct 20 '22 04:10

Diskdrive


1 Answers

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!

like image 133
Jonathan Moffatt Avatar answered Oct 31 '22 16:10

Jonathan Moffatt