ford prefect ford prefect - 3 years ago 191
Javascript Question

Chrome Dev Tools hitting code but not breakpoints

I have breakpoints enabled on chrome dev tools and I have a breakpoint on a line. I know chrome is hitting the line because I put the breakpoint on a line that has the following statement:

alert("why is this not breaking")
The breakpoint works if I find the file in the localhost. The breakpoints used to function in the local editor but now they won't. Has anyone else had a similar problem?

Answer Source

I had a similar problem not hitting my breakpoints. Turned out it was because it was a deployed version of the site but the dev tools still had my local dev folder mapped to the workspace, the meant I had the local script files open not the ones on the server. The solution was to close the opened local scripts, opening the right files in the navigator and then setting the breakpoints.

OK I was a bit dumb not realising it in the first place, but this might serve as a good note for anyone else having the same problem as me.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download