How to make Webstorm 2016.2 debug work with ES6 and babel

I have been searching for quite sometime for this today but could not find a clue. Basically what I am trying to achieve is to be able to debug a server side node app written in es6.

In Edit Configuration, the screen looks like:

When I debug this app, it would seems to stop at my break point, however, the line number is not correct. Do I have to setup source map somehow in order to make debugging work with es6?

Thanks,

xigua

1
10 comments

Please try using

node -r babel-register

instead of babel-node (see comments in https://youtrack.jetbrains.com/issue/WEB-21949) - does it work for you?

1
Avatar
Permanently deleted user

Nop. It didn't work. When it started, the printed out exec is:

 

/Users/xigua/.nave/installed/5.8.0/bin/node --debug-brk=64402 --expose_debug_as=v8debug -r babel-register /Users/xigua/Projects/jizhi/service/redmine-service/notify.js

But stopped the line number totally messed up. 

Any other work around?

Thanks,

0

Please can you provide a project that shows up the issue?

0
Avatar
Permanently deleted user

I attached the project tgz file at the end of this issue https://youtrack.jetbrains.com/issue/WEB-21949

You can extract the content and test it out. This project contains an .idea project setup with run configuration.

I would do the following to set things up:

nave use 5.8.0

npm install

Really appreciate your help.

Thanks,

0

Can't reproduce the issue with your project - debugging works fine for me, line numbers seems to match... see the screencast attached to the ticket

0
Avatar
Permanently deleted user

Thanks Elena, 5.10.0 works. :)

0

Great, thanks for letting me know!

0
Avatar
Permanently deleted user

This is my configuration and it works like a charm :)

 

3

i had to add --ignore nothing to the node params.   i can debug with any framework this way, but how can i write a plugin for intellij to detect the tests exported by the framework, so you can easily run just one test?

0

Not sure I follow you... Would you like to develop a plugin for a custom test runner/framework? You can find basic documentation about plugin development here: http://www.jetbrains.org/intellij/sdk/docs/. Mocha runner is not fully open source, but its JavaScript part is open source (https://github.com/JetBrains/mocha-intellij). Also, there is an open source plugin for Karma https://github.com/JetBrains/intellij-plugins/tree/master/js-karma. You can use these plugins as an example

0

Please sign in to leave a comment.