Chrome Dev Tools hitting code but not breakpoints

后端 未结 4 2207
陌清茗
陌清茗 2021-02-12 22:18

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

相关标签:
4条回答
  • 2021-02-12 22:38

    Should anyone stumble across this later. I have yet to find a definitive answer to this question but these are some other where I have found some helpful info:

    Chrome developer tools workspace mappings

    Chrome Stable/Canary Dev Tools Issues - Syntax Highlighting Auto-Complete etc

    I will continue to update this should I find a real solution

    The accepted answer is correct here.

    0 讨论(0)
  • 2021-02-12 22:39

    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.

    0 讨论(0)
  • 2021-02-12 22:42

    The debugger; tip in Chrome javascript debugger breakpoints don't do anything? helped me find where my mistake was.

    I'm working on a Rails project for the first time, and there were two versions of the file without my knowing it. Rails' "asset pipeline" used a //= require foo statement to import, and the same foo file was also included somewhere else.

    The debugger; pointed me to the right place, thankfully.

    0 讨论(0)
  • 2021-02-12 22:47

    You should enable the setting to stop on any exception, in the Sources tab on the developer page (F12 in chrome). (Unload your other extensions to help focus only on the problem one, and remove their thumbnails on the left panel too).

    There may be an exception thrown earlier than any debug breakpoint you have set. E.g. there if there is a missing extension permission requirement in the manifest file, which causes an exception to be thrown once it tries to use the resource but can't.

    0 讨论(0)
提交回复
热议问题