Unexpected token ILLEGAL when debugging coffeescript

Trying to get some coffeescript debugging going in WebStorm.

```

C:\Users\jcollum\AppData\Roaming\npm\coffee:2
basedir=`dirname "$0"`
        ^
SyntaxError: Unexpected token ILLEGAL


```

You can see the setup for Mocha debugging in the attached screenshot. It looks like I'm setting it up correctly. I found a blog post (that doesn't use coffeescript though) that detailed how to set it up and I'm following that. Unfortunately I'm getting this cryptic error message. I've messed around a bit and never gotten any better results.

Attachment(s):
Capture05.PNG
7 comments
Comment actions Permalink

Justin, please attach screenshot with the error message.

Kirill

0
Comment actions Permalink

attached



Attachment(s):
Capture06.PNG
0
Comment actions Permalink

This error was caused by execution of "C:\Users\jcollum\AppData\Roaming\npm\_mocha" as CoffeeScript source.
WebStorm 5 can't debug CoffeeScript Mocha tests for Node.js, but it can run them.

Open the attached project in IDE and run "mocha-tests-run" Run Configuration.
It should output:

  ․

  1 test complete (1 ms)



Attachment(s):
Coffee-Mocha-test-run.png
coffee-mocha-sample-tests.zip
0
Comment actions Permalink

Thanks Sergey, that was helpful. Did you read that blog post? It's very recent and discusses debugging mocha tests in webstorm.

0
Comment actions Permalink

That article is about JavaScript Mocha test debugging and you asked about CoffeeScript Mocha tests debugging.
The problem is that WebStorm 5 doesn't support CoffeeScript Node.js debugging.

0
Comment actions Permalink

Seems like I should be able to get this to work by running it through a transpiler first. Suggestions?

0
Comment actions Permalink

If you'd like to debug generated JavaScript code then you need to run CoffeeScript sources through a transpiler first and after follow the step from that article.

CoffeeScript Node.js code debugging will likely be available in WebStorm 6.0.x version (you'll need to run CoffeeScript sources through a transpiler first and also generate source maps).


0

Please sign in to leave a comment.