Webstorm does not stop node execution when using nodemon

Webstorm 2016.3.5 does not stop node app execution (breakpoints don't work) when using nodemon.  I enabled nodemon with the Run/Debug Configuration using the path to nodemon.js in the "Node parameters" section.  Debugging works fine and breakpoints work when I remove nodemon.  Perhaps this a node issue and not Webstorm.

 

Is there a better way to enable nodemon and still have debugging work?    Or is there a way to set Webstorm to do the watching itself and automatically restart the node app, and not have to use nodemon?

Thank you.

 

 

0
13 comments

You can use Live Edit (https://blog.jetbrains.com/webstorm/2014/08/live-edit-updates-in-webstorm-9/) to hotswap changes/restart server if necessary.

0

Thanks for the reply.  I enabled Auto in Debugger > Live Edit > Update, but it's still not restarting the server on code changes.  Is there something else I need to enable?

I started the server using the Debug icon (not Run).  I'm guessing that's correct.

0

Did you try enabling 'Restart if hotswap fails' ? When this option is enabled, WebStorm  tries to restart the server if the changes cannot be applied automatically

0

Thanks Elena.  I enabled that option, but it's still not restarting on code changes.

The event log tells me that it can't update a compiled js file because of syntax errors.  I wonder if that's why it isn't restarting node.  I'm investigating that now.  WS reports a couple syntax errors in the js file, but they really aren't errors.  The Node app runs fine and doesn't complain about errors.

0

what errors do you see?

 

>I wonder if that's why it isn't restarting node. 

 

yes, likely

0

It's Typescript compiled into Javascript.  Target is es6 in the tsconfig.json, and Webstorm is compiling the TS just fine.  The node app runs.  

0

it's the same issue then...

0

Alright, so I guess Live Edit isn't going to work for me.  

But why is WS reporting a syntax error in the compiled JS when there really isn't one?

0

I changed my Javascript version to ES6 in Webstorm, and now Live Edit is working.

But here's another question -- I must not be understanding how the hot swap works.  I was expecting to see the node app restarting in the WS console, but that doesn't happen.  I do see "script reloaded" in the Event Log.

0

if application can be changed without restart (with hotswapping), server is not restarted, so you won't see it restarting in console

0

The Live Edit reload feature seems somewhat unreliable. Mine stopped working, then started again after a couple hours, then stopped. I don't see anything in the Event Log when it's not working. I didn't change any settings. Any idea what's going on there?

0

no idea; I'm not aware of any issues that may cause it

0

Please sign in to leave a comment.