javascript - 如何在控制台中调试 Ext JS 4 错误

标签 javascript extjs user-interface extjs4.2

错误之一是不允许应用程序完全加载。错误消息非常笼统,没有清楚说明有问题的模块:

Uncaught TypeError: Cannot read property 'data' of null
Uncaught TypeError: Cannot read property 'data' of null ext-all-debug.js:62557 Ext.define.setLabels ext-all-debug.js:62557 Ext.define.applyData ext-all-debug.js:62578 Ext.define.drawAxis ext-all-debug.js:61899 Ext.define.redraw ext-all-debug.js:60442 Ext.define.afterComponentLayout ext-all-debug.js:60382 Ext.define.notifyOwner ext-all-debug.js:37353 Ext.define.callLayout ext-all-debug.js:119598 Ext.define.flushLayouts ext-all-debug.js:119767 Ext.define.runComplete ext-all-debug.js:120253 callOverrideParent ext-all-debug.js:39 Base.implement.callParent ext-all-debug.js:4266 Ext.override.runComplete ext-all-debug.js:29267 Ext.define.run ext-all-debug.js:120234 Ext.define.statics.flushLayouts ext-all-debug.js:29275 Ext.define.statics.resumeLayouts ext-all-debug.js:29283 Ext.resumeLayouts ext-all-debug.js:31760 Ext.define.render ext-all-debug.js:28510 Ext.define.constructor ext-all-debug.js:29579 Base.implement.callParent ext-all-debug.js:4266 Ext.define.constructor ext-all-debug.js:33595 constructor ext-all-debug.js:4897 (anonymous function) Ext.ClassManager.instantiate ext-all-debug.js:5485 (anonymous function) ext-all-debug.js:2112 Ext.apply.create ext-all-debug.js:3788 Ext.define.initViewport ext-all-debug.js:57187 Ext.define.onBeforeLaunch ext-all-debug.js:57159 Ext.define.constructor ext-all-debug.js:57099 constructor ext-all-debug.js:4897 (anonymous function) ext-all-debug.js:7794 createSingle ext-all-debug.js:9863 fire ext-all-debug.js:9818 Ext.apply.readyEvent.readyEvent.fire ext-all-debug.js:10052 Ext.apply.fireReadyEvent ext-all-debug.js:10130 Ext.apply.onDocumentReady ext-all-debug.js:10148 Ext.apply.onReady.fn ext-all-debug.js:6658 Ext.apply.triggerReady ext-all-debug.js:6644 Ext.apply.refreshQueue ext-all-debug.js:6177 Ext.apply.refreshQueue ext-all-debug.js:6207 Ext.apply.refreshQueue ext-all-debug.js:6207 Ext.apply.refreshQueue ext-all-debug.js:6207 Ext.apply.refreshQueue ext-all-debug.js:6207 Ext.apply.refreshQueue ext-all-debug.js:6207 Ext.apply.refreshQueue ext-all-debug.js:6207 Ext.apply.refreshQueue ext-all-debug.js:6207 Ext.apply.onFileLoaded ext-all-debug.js:6587 (anonymous function) ext-all-debug.js:2105 Ext.apply.injectScriptElement.onLoadFn

错误指向 ext-all-debug.js 文件。 我如何找出它指向我的应用程序的哪个文件?

尝试通过inspector调试;但没有成果。

最佳答案

ext-all-debug.js 是框架中可用的所有 Ext JS 类的编译。当你调试你的应用程序时,使用 ext-dev.js 会更容易;此文件仅包含核心,所有其他类均使用 Ext.Loader 动态加载.请注意,仅切换到 ext-dev.js 并不能消除错误,但它可以让您轻松快速地查明其位置。

将浏览器调试器设置为在未处理的异常时中断也是有益的。结合动态加载,你会在错误所在的地方得到一个断点,你可以立即看到是哪个类和方法。这、堆栈跟踪和范围变量应该为您提供足够的线索来找到异常的原因。

我还建议您查看 Sencha Cmd ,它可以帮助您管理应用程序的构建过程。

关于javascript - 如何在控制台中调试 Ext JS 4 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18458312/

相关文章:

javascript - 将 CSS/JS 放在哪里最好——顶部、主体还是底部?

javascript - jQuery 使用 Google Analytics 跟踪事件

javascript - 删除鼠标移开时的 Mapbox 折线

javascript - ExtJS:容器默认样式从何而来?

java - 是否可以将 OutputStream 从 java applet 连接到浏览器的下载窗口?

javascript - 对 ExtJS 面板内的 HTML 元素执行 getElementById

javascript - Sencha Cmd, C2001 闭包编译错误 : extending native class: Array

java - 使用的 GUI 框架是什么,是具有优秀 GUI 的网站,如 twitter、www.groupon.com 等

java - 在存储文件中发生更新后,如何在java中自动刷新gui屏幕?

python - 用于 Snow Leopard(64 位)的漂亮 Python GUI 工具包