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

8 comments
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

Thanks Elena, 5.10.0 works. :)

0
Comment actions Permalink

Great, thanks for letting me know!

0
Comment actions Permalink

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

 

2

Please sign in to leave a comment.