Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome won't let me place breakpoints

I've been using Google Chrome to debug my javascript, but then all of a sudden I can no longer place breakpoints. I click on the line number, where I previously clicked to add a breakpoint, but no breakpoint will be added. Sometimes if I click very fast, like a madman, I can see it trying to add breakpoints, but it won't stick.

The only thing I changed was adding JSONView. I uninstalled that, but still can't add breakpoints.

Does anyone have any idea?

An edit: I can place breakpoints on other pages, like StackOverflow, just not the one I'm developing running on localhost.

like image 866
MrGrigg Avatar asked Oct 20 '10 17:10

MrGrigg


People also ask

How do I debug IOS in Chrome?

In Chrome on your iPad or iPhone, go to chrome://inspect and then press Start Logging. Now go do your thing in another tab, keeping this tab open. Come back anytime to see any and all console outputs!


2 Answers

No it's not fixed. The Chrome debugger has done this for as long as I can remember. Just close and reopen the debugger and it usually comes right again. Sometimes you may need to try several times for it to work.

like image 57
Bob Avatar answered Sep 25 '22 03:09

Bob


This bug was fixed yesterday (February 3) with the introduction of a new api for managing JavaScript breakpoints: http://code.google.com/p/chromium/issues/detail?id=69988

I downloaded the most recent Chromium nightly from http://build.chromium.org/f/chromium/snapshots/ and was able to successfully set breakpoints in JavaScript, which I had been unable to do using the current stable/beta/dev builds of Chrome.

Hopefully this fix will be incorporated into the next releases of Chrome. Until then, adding debugger; statements to your code is a decent workaround for setting breakpoints.

like image 33
Patrick Lewis Avatar answered Sep 23 '22 03:09

Patrick Lewis