1
我有一个简单的应用程序运行在我的本地主机和UAT环境。最近添加了一个新组件,并且所有组件在本地运行良好。Extjs应用程序问题,当不在本地主机
当我将应用程序部署到UAT时,我在控制台中得到以下2个错误。
/widget/label.js?_dc=1482256656320 404 (Not Found)
Uncaught TypeError: c is not a constructor(anonymous function) @ VM224:3Ext.ClassManager.Ext.apply.create @ app.js?_dc=1482256653415:1Ext.ClassManager.Ext.apply.widget @ app.js?_dc=1482256653415:1Ext.cmd.derive.create @ app.js?_dc=1482256653415:1Ext.cmd.derive.lookupComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.privates.prepareItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.add @ app.js?_dc=1482256653415:1Ext.cmd.derive.initItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.initComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.constructor @ app.js?_dc=1482256653415:1ak @ app.js?_dc=1482256653415:1Ext.ClassManager.Ext.apply.widget @ app.js?_dc=1482256653415:1Ext.cmd.derive.create @ app.js?_dc=1482256653415:1Ext.cmd.derive.lookupComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.lookupComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.privates.prepareItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.add @ app.js?_dc=1482256653415:1Ext.cmd.derive.initItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.initComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.initComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.constructor @ app.js?_dc=1482256653415:1ak @ app.js?_dc=1482256653415:1Ext.ClassManager.Ext.apply.widget @ app.js?_dc=1482256653415:1Ext.cmd.derive.create @ app.js?_dc=1482256653415:1Ext.cmd.derive.lookupComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.privates.prepareItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.add @ app.js?_dc=1482256653415:1Ext.cmd.derive.initItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.initComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.initComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.initComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.constructor @ app.js?_dc=1482256653415:1ak @ app.js?_dc=1482256653415:1Ext.cmd.derive.applyTabBar @ app.js?_dc=1482256653415:1k @ app.js?_dc=1482256653415:1Ext.Configurator.configure @ app.js?_dc=1482256653415:1Ext.Base.r.addMembers.initConfig @ app.js?_dc=1482256653415:1Ext.cmd.derive.constructor @ app.js?_dc=1482256653415:1ak @ app.js?_dc=1482256653415:1Ext.ClassManager.Ext.apply.widget @ app.js?_dc=1482256653415:1Ext.cmd.derive.create @ app.js?_dc=1482256653415:1Ext.cmd.derive.lookupComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.privates.prepareItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.add @ app.js?_dc=1482256653415:1Ext.cmd.derive.initItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.initComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.constructor @ app.js?_dc=1482256653415:1ak @ app.js?_dc=1482256653415:1Ext.ClassManager.Ext.apply.widget @ app.js?_dc=1482256653415:1Ext.cmd.derive.create @ app.js?_dc=1482256653415:1Ext.cmd.derive.lookupComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.privates.prepareItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.add @ app.js?_dc=1482256653415:1Ext.cmd.derive.initItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.initItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.initComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.initComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.constructor @ app.js?_dc=1482256653415:1ak @ app.js?_dc=1482256653415:1Ext.ClassManager.Ext.apply.widget @ app.js?_dc=1482256653415:1Ext.cmd.derive.create @ app.js?_dc=1482256653415:1Ext.cmd.derive.lookupComponent @ app.js?_dc=1482256653415:1Ext.cmd.derive.privates.prepareItems @ app.js?_dc=1482256653415:1Ext.cmd.derive.add @ app.js?_dc=1482256653415:1Ext.Ajax.request.success @ app.js?_dc=1482256653415:1Ext.apply.callback @ app.js?_dc=1482256653415:1Ext.cmd.derive.onComplete @ app.js?_dc=1482256653415:1Ext.cmd.derive.onStateChange @ app.js?_dc=1482256653415:1(anonymous function) @ app.js?_dc=1482256653415:1
sencha app build
命令成功完成,并且本地没有发生JS错误。
当应用程序被捆绑时,这可能与生产构建设置有关吗?如果我删除了新的组件,应用程序部署并完美运行。
可能需要重新构建应用程序。尝试在重建之前清除构建文件夹。 – aMazing
感谢您的信息。原来我没有在新组件中的require数组中包含'Ext.form.Label'。这真的很明显,但我很困惑为什么我的本地主机版本没有错误。如果未声明,我的本地版本是否可以自动包含此引用? – grimmus
在未来,您可能还会尝试'sencha应用程序构建测试',它应该会向您显示更多信息。 – pagep