Chrome开发工具点击代码,但不会断点 [英] Chrome Dev Tools hitting code but not breakpoints

查看:191
本文介绍了Chrome开发工具点击代码,但不会断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在chrome开发工具上启用了断点,我有一个断点。我知道chrome正在上线,因为我把断点放在一条含有以下语句的行上: alert(为什么这不会破坏)断点如果我找到该文件在本地主机。断点用于在本地编辑器中运行,但现在他们不会。有没有其他人有类似的问题?

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?

推荐答案

我有一个类似的问题,没有打我的断点。原来是因为它是一个部署的版本的网站,但开发工具仍然有我的本地dev文件夹映射到工作区,这意味着我的本地脚本文件不打开服务器上的文件。解决方案是关闭打开的本地脚本,在导航器中打开正确的文件,然后设置断点。

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.

这篇关于Chrome开发工具点击代码,但不会断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆