Debugging JavaScript: break on exception works, but breakpoints don't?

Hello, I am trying out the JavaScript debugging in IDEA 11.1. I have my debug configuration set up and can launch my application (an ExtJS 4.1 app). Chrome opens with a brief message saying "Connecting to IDEA..." and then the app loads. I can see my breakpoint(s) in the JavaScript Line Breakpoints list. However, even though the code with the breakpoint runs, the breakpoint is never hit and the app never suspends. I've even checked the box next to "Log Message to Console", but nothing ever shows in the console.

However, if I introduce an error to the same line of code and run with the "break on exception" turned on, execution suspends at the line of the error.

If it matters, I can open Chrome's dev tool panel and place a breakpoint at the same line and run, and Chrome suspends at the correct line. So the breakpoint location within my JS function should definitely be getting hit.

I'm not sure what else to try. Is there some trick to getting this to work, or is it a bug in IDEA?



Comment actions Permalink

What url do you open in the browser? Does it point to a file on the disk or it is served by some server?
Could you please create a new html file, add simple javascript code inside 'body', put a breakpoint in it and try to debug to check whether the
breakpoint works in such case?

Nikolay Chashnikov
Software Developer
JetBrains, Inc
"Develop with pleasure!"

Comment actions Permalink

I'll try what you suggested but just to answer your question, in case it matters, the debug configuration is a remote JS configuration with a url like:


And the file path mapping something like:

http://localhost:8080/myapp = c:\developer\tomcat\webapps\myapp

Would this make a difference? I assumed this was the way to do it since I need to run the app through the web server since it uses AJAX, and the "local JS config" only takes a file path not a url...


Please sign in to leave a comment.