简体   繁体   English

Chrome Dev Tools命中代码而不是断点

[英]Chrome Dev Tools hitting code but not breakpoints

I have breakpoints enabled on chrome dev tools and I have a breakpoint on a line. 我在chrome dev工具上启用了断点,并且我在一条线上有一个断点。 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. 我知道chrome正在线上,因为我把断点放在一行上有以下语句: alert("why is this not breaking")如果我在localhost中找到该文件,断点就会起作用。 The breakpoints used to function in the local editor but now they won't. 断点用于在本地编辑器中运行,但现在他们不会。 Has anyone else had a similar problem? 有没有其他人有类似的问题?

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. 好吧,我有点愚蠢没有意识到它,但这可能是一个很好的记录,其他任何人都有与我相同的问题。

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开发人员工具工作区映射

Chrome Stable/Canary Dev Tools Issues - Syntax Highlighting Auto-Complete etc Chrome稳定版/ Canary开发工具问题 - 语法突出显示自动完成等

I will continue to update this should I find a real solution 如果我找到真正的解决方案,我会继续更新

The accepted answer is correct here. 接受的答案在这里是正确的。

The debugger; debugger; tip in Chrome javascript debugger breakpoints don't do anything? Chrome中的提示javascript调试器断点不做任何事情? 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项目上工作,并且在我不知道的情况下有两个版本的文件。 Rails' "asset pipeline" used a //= require foo statement to import, and the same foo file was also included somewhere else. Rails的“资产管道”使用//= require foo语句导入,同样的foo文件也包含在其他地方。

The debugger; debugger; pointed me to the right place, thankfully. 谢天谢地,我把它指向了正确的地方。

You should enable the setting to stop on any exception, in the Sources tab on the developer page (F12 in chrome). 您应该在开发者页面的源代码选项卡中启用设置以停止任何异常(铬中的F12)。 (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. 可能会比您设置的任何调试断点更早抛出异常。 Eg 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. 例如,如果清单文件中缺少扩展权限要求,则一旦尝试使用该资源但不能引发异常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Chrome开发工具:断点消失了吗? - Chrome Dev Tools: Breakpoints Disappear? 有没有办法在 chrome 开发工具中为每个 js 行设置断点? - Is there a way to set breakpoints for every js line in the chrome dev tools? 即使停用断点,Chrome 开发工具也会在断点处停止 - Chrome Dev Tools stops at breakpoint even when breakpoints are deactivated 修改javascript代码Chrome开发工具 - Modify javascript code chrome dev tools Chrome 开发工具 - 导航期间的代码覆盖率 - Chrome Dev Tools - Code Coverage during navigation Chrome 开发工具并没有在添加断点时停止,而是在 React 模块中出现不同的异常时停止 - Chrome dev tools didn't stopped on added breakpoints, instead they stopped at different exceptions present in React Modules 早午餐源映射:不在Chrome devtools中击中断点 - Brunch source mapping: not hitting breakpoints in Chrome devtools 断点未在Chrome v33.0.1750.154中达到 - Breakpoints not hitting in Chrome v33.0.1750.154 为什么Chrome Dev Tools检查器显示的值与代码中的值不同? - Why is Chrome Dev Tools inspector showing different values than in code? 转到Chrome开发工具扩展程序中的源代码行? - Go to source code line in Chrome dev tools extension?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM