简体   繁体   English

为什么Chrome暂停jQuery内部的某行?

[英]Why is Chrome pausing on some line inside jQuery?

Every time I refresh my web app with the Chrome Inspector open it pauses and takes me to the sources tab with a big red arrow icon pointing to some weird line inside jQuery. 每次我打开Chrome Inspector刷新我的Web应用程序时,它都会暂停,并带我到“源”选项卡,其中带有一个红色大箭头图标,该图标指向jQuery中的一些怪异行。

I see 我懂了

Paused in debugger 在调试器中暂停

in the top-middle of the window, and 在窗口的顶部中间

Paused on exception: DOMException 在异常上暂停:DOMException

in the Call Stack on the sources tab. 在“源”选项卡上的“调用堆栈”中。

As far as I'm aware, I haven't set any breakpoints and this code wasn't throwing exceptions before - so what's going on? 据我所知,我还没有设置任何断点,并且此代码之前没有引发异常-那么怎么回事?

That little pause icon in the lower left. 左下角的小暂停图标。 Should be black in color. 应为黑色。 Click it to cycle through several breakpoint options. 单击它可以循环浏览几个断点选项。

I had been debugging and forgotten to remove a breakpoint. 我一直在调试,忘了删除断点。

事件侦听器断点

还要检查您是否没有在XHR Breakpoints下打勾“ Any XHR”。

To disable this on On Windows for Chrome. 要在Windows for Chrome上禁用此功能。

In "Script" button circled in red below, cycle to same state ("Don't pause on Exceptions") 在下面用红色圈出的“脚本”按钮中,循环至相同状态(“在异常时不要暂停”)

在此处输入图片说明

This can also cause the issue 这也可能导致问题

Break Point icon at top left should be blue like this(For Deactivate BreakPoints) 左上方的“断点”图标应为蓝色(用于停用断点)

在此处输入图片说明

Should not grey like this 这样不应该灰白

在此处输入图片说明

通过关闭开发人员工具,刷新页面然后打开开发人员工具,我能够清除使用Chrome时出现的幻影断点。

Solution for Visual Studio debugging Visual Studio调试解决方案

I had the same problem with the "Paused in debugger" showing up when I was building a website with MVC 5 and razor. 使用MVC 5和剃须刀构建网站时,出现“在调试器中暂停”的问题。

What solved the problem for me was to: 为我解决问题的是:

  1. Remove all breakpoints in the code (some were set in JavaScript code). 删除代码中的所有断点(某些断点是在JavaScript代码中设置的)。

  2. Start debugging the project, click the "Exception settings" tab, and deselected "JavaScript (Chrome) Exceptions" checkbox. 开始调试项目,单击“异常设置”选项卡,然后取消选中“ JavaScript(Chrome)异常”复选框。

  3. Stop debugging - Settings will apply first after a restart 停止调试-重启后将首先应用设置

  4. Start debugging - no more "Paused in debugger" 开始调试-不再“已在调试器中暂停”

Somewhere along the line, I must have checked the "JavaScript (Chrome) Exceptions" checkbox, and forgot about it. 我必须选中“ JavaScript(Chrome)例外”复选框,然后忘记了。

Link to Exception Settings Image 链接到例外设置图像

for me this was the problem: 对我来说,这就是问题所在: 在此处输入图片说明 I had to uncheck the any XHR or fetch checkbox 我必须取消选中任何XHR或获取复选框

Conclusion: I don't know if you if this will fix the problem but I guess that if you have any checkbox checked in any tab that has Breakpoints in its name just uncheck it and see if it works, and uncheck breakpoint symbol in the top left bar till it's grey, and then you will need to hit the pause or play button in the top left bar and nothing should appear any more. 结论:我不知道您是否能解决问题,但我想如果您在名称中具有断点的任何选项卡中选中了任何复选框,只需取消选中它,看看是否可行,然后在顶部取消选中断点符号左栏,直到它变成灰色为止,然后您需要按一下左上栏的暂停或播放按钮,并且不再显示任何内容。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM