简体   繁体   English

Javascript不报告错误

[英]Javascript not reporting errors

So, I'm writing an application that has ~5k lines of javascript... and it's stopped reporting errors. 因此,我正在编写一个应用程序,其中包含约5,000行的javascript ...,并且已停止报告错误。 No firebug, IE triangle thing, nothing. 没有萤火虫,IE三角的东西,什么都没有。 It just won't work if there's an error. 如果有错误,它将无法正常工作。 Anyone seen anything like this before? 有人看过这样的东西吗? Debugging is somewhat... frustrating... 调试有点...令人沮丧...

My best guess is too many layers of abstraction? 我最好的猜测是太多的抽象层? But there aren't really that many. 但是实际上并没有那么多。

Something else is wrong. 还有其他问题。 It's not simply the size of your javascript. 这不仅仅是您的javascript的大小。 I'm running 70,000 lines of JavaScript in Chrome's debugger and FireFox 6's firebug and there are no debugging problems. 我在Chrome的调试器和FireFox 6的firebug中运行了70,000行JavaScript,并且没有调试问题。

Look elsewhere. 看其他地方。 Is something not getting loaded? 东西没装上吗? Do you need to clear cache and refresh? 您是否需要清除缓存并刷新? Try another browser (like Chrome) and see the results. 尝试使用其他浏览器(例如Chrome),然后查看结果。

If it stopped reporting errors, its more likely those errors do not exist in your current revision, or that a block of code that you think is executing is actually never run. 如果它停止报告错误,则很可能这些错误在当前版本中不存在,或者您认为正在执行的代码块实际上从未运行过。 Set a breakpoint. 设置一个断点。

99% your script is not executing at all. 99%的脚本根本没有执行。 You need manual trace, either with breakpoints, console.logs or alerts. 您需要使用断点,console.logs或警报进行手动跟踪。

1% is that you have error handlers, who silence them. 1%是您有错误处理程序,可以使它们静音。 Look for suspicious try { .. } catch () {} and window.onerror . 寻找可疑的try { .. } catch () {}window.onerror

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

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