AngularJS: debug grunt server hangs at Running "concurrent:server" (concurrent) task
I'm using WebStorm 10, latest version. I'd like to be able to launch and debug my angular project within Webstorm. I can debug and do inspections in Chrome, but it's annoying to have to swtich back and forth between developer tools and webstorm. I found the grunt task panel, and I can run "grunt serve" successfully. However, when I try and debug that task, it just hangs at the Running "concurrent:server" (concurrent) task and a browser window is never opened.
Any suggestions on how to fix that?
Thanks for the help.
Andrew
Console output:
/usr/local/bin/node --debug-brk=57589 /usr/local/lib/node_modules/grunt-cli/bin/grunt --gruntfile /Users/cantgetnosleep/development/nodestuff/writerwright/client/Gruntfile.js serve
Debugger listening on port 57589
Running "serve" task
Running "clean:server" (clean) task
>> 1 path cleaned.
Running "wiredep:app" (wiredep) task
Running "wiredep:test" (wiredep) task
Running "wiredep:sass" (wiredep) task
Running "concurrent:server" (concurrent) task
Please sign in to leave a comment.
So I got this to kinda work by creating a Javascript Debug task and using that (as well as just running "grunt serve" separately in the terminal). Is this the preferred way to do this?
Andrew
The problem is likely caused by the way Grunt spawns child tasks. By default, the spawned child process uses the same debug port as a parent process - as a result the forked process is suspended and the application 'stalls'. See http://stackoverflow.com/questions/19252310/how-to-fork-a-child-process-that-listens-on-a-different-debug-port-than-the-pare, for example.
Please try adding
at the top of your Gruntfile.js - does it help?
I was running into this same issue for months and couldn't figure out why it was hanging. The above suggestion (adding process.execArgv = []; to the Gruntfile) worked great and has my debugger working again, so I no longer need to use my browser's built-in debugger.
Thanks!