Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging node app in WebStorm when run from gulp

I am using webstorm 10.0.2 and have used the bangular yeoman template to generate a project. I can run the gulp commands via the gulp window, and I can set a breakpoint in the gulpfile.js and it will hit it, but I can't seem to get it to hit a breakpoint in my server.js

It looks to me like the gulp file is launching another instance of node and thus when you do "debug" from webstorm you are just debugging the gulp.

I also tried with another project using yo hottowel but get the same thing - I am unable to debug the actual application through webstorm.

Can anybody tell me how to configure webstorm so that I can debug the actual server side node code but still use the gulp build tool?

like image 491
gremwell Avatar asked May 03 '15 13:05

gremwell


People also ask

How do I start WebStorm debugging?

Start debugging If your application is running in the development mode on localhost , you can start debugging it from the built-in Terminal ( Alt+F12 ), from the Run tool window, or from the Debug tool window. Just hold Ctrl+Shift and click the URL at which the application is running.

How do I debug next JS in WebStorm?

Just hold Ctrl+Shift / ⌘⇧ and click the URL address where the application is running. WebStorm launches the auto generated Debug Application run/debug configuration, the browser opens at http://localhost:3000/, and the Debug tool window appears showing you the call stack and variables.


1 Answers

I contacted JetBrains support back in May 2015 and their response was:

It seems this cannot be done quickly. In short, the problem is that serve-dev task starts new process (nodemon) that takes app.js There is no workaround how to debug such spawned processes right now. We would really appreciate if you'll submit a feature request about it in our YouTrack: https://youtrack.jetbrains.com/issues/WEB The only way you can try to avoid it - try to create a separate task that will run app.js directly without nodemon process and debug this task instead.

like image 168
gremwell Avatar answered Sep 24 '22 19:09

gremwell