Firebug - Breakpoint doesn't hit

23,623

Solution 1

If the line numbers aren't green, it seems like Firebug cannot debug that part of code because it is out of scope. So, if you're using something like $(function () { ... }); Firebug will not be able to access Functions and variables.

Does that make sense?

Also, is it possible that some other function or something is overriding the one you're trying to debug. It's even possible if you're including the same JS file twice.

Hope that helps.

Solution 2

I'm having this problem very often too. I've found out that reopening the tab seems to help (the breakpoints are not lost). But "Break on all errors" looks to be the most reliable way for breaking.

I rarely have to something good about IE, but in this case it gets it right. Debugging JavaScript in VS just works. It hits breakpoints ("debugger") without a problem and stops all other JavaScript code on the page from executing. So I use it as a back-up quite often.

Solution 3

Does Firebug show the code in the Script tab with green line numbers? This indicates debuggable lines of code.

I've experienced this symptom where none of the line numbers were green at times. I refresh the page and magically, they're green again.

Solution 4

I have experienced this problem when trying to debug pages within frames using Firebug 1.4. Selecting "Show only this frame" or "Open frame in new tab" from the "This frame" context menu then refreshing the page seems to make the scripts debuggable.

Solution 5

Does the 'Console' tab on Firebug show errors for any of your other JavaScript? I found that if JavaScript errors exist for code prior to a debug breakpoint then it will never reach that line of code until the preceding broken one(s) are fixed.

Share:
23,623
DotnetDude
Author by

DotnetDude

Updated on May 04, 2020

Comments

  • DotnetDude
    DotnetDude about 4 years

    I am setting breakpoints in an external JS file and I haven't been able to get Firebug hit the breakpoint in a consistent way. It works sometimes but most of the times it doesn't. The only way I can get it to work is by switching on "Break on all errors"

    I have used the debugger; statement as well without any luck.