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