MonkeyBonkey
MonkeyBonkey

Reputation: 47921

debugger suddenly stopped working in webstorm project

My webstorm ide won't stop on breakpoints in my existing Node.js project anymore.

It seems to work fine when I create a new webstorm node.js express project and set a debug point.

For example, for a very simple test, I create a file in my existing project called test.js:

var name = 'bob';
console.log(name);

create a run/debug configuration

Name:test
Path to Node:/usr/local/bin/node
workding directory: Path to my directory
Path to Node App JS file: test.js

I set a break point to line 1 which never gets hit, even though the program runs fine. How can I get the debugger to hit breakpoints again on this project.

Output

/usr/local/bin/node --debug-brk=64597 test.js
debugger listening on port 64597
bob

Process finished with exit code 0

The same project copied into another directory works fine in the debugger. However if I keep it in the same directory, even if I delete the .idea folder and recreate the debug configuration from scratch it won't attach to the debugger.

I was playing around with JSTestDriver settings earlier.. could that have affected things and continued to affect things even though the .idea folder was deleted?

Upvotes: 7

Views: 4733

Answers (5)

Adam Gawne-Cain
Adam Gawne-Cain

Reputation: 1720

I have noticed that breakpoints can stop working if you have two source files with identical names but in different folders. I was using identical names to shorten and group import statements. When I renamed my files to different names then breakpoints started working again.

Upvotes: 0

Arman Yeghiazaryan
Arman Yeghiazaryan

Reputation: 6983

Rename (delete) the .idea folder from the root of your project and try again.

[edit]
as @Silvio Biasiol suggested, you better do a backup of your .idea folder before moving/renaming/removing it. The .idea folder actually contains temporary but sometimes important information (i.e. Webstorm has its inner version controlling history, which might be vital for some people) that you might want to recover later.

Upvotes: 2

Serhii Kuts
Serhii Kuts

Reputation: 449

I had the same issue, my express app stop working with code 0.

I've placed breakpoint in the first line of my code and just step over. At some point I found that one of my controllers returned undefined and caused process to exit.

After fix I recieved standard express is listening on port xxxx

Upvotes: 0

Lavamantis
Lavamantis

Reputation: 3826

The same thing happened to me as well. I finally rebooted my machine and Webstorm started hitting breakpoints again. It's not a great answer, but at least it worked.

Upvotes: 4

develar
develar

Reputation: 995

http://youtrack.jetbrains.com/issues/WEB may be is more suitable place for report WebStorm bugs ;) http://youtrack.jetbrains.com/issue/WEB-2313 may be related.

Upvotes: 0

Related Questions