2015-05-12 56 views
0

我使用Extjs 5,sencha cmd 5和extjs sencha圖表。Sencha應用程序生成生產成功,但生產頁面無法加載.js未找到錯誤

'app'目錄中我的應用程序的index.html工作正常,sencha應用程序成功構建。 當我去到生產包裝加載生產的index.html,控制檯給我的錯誤「.JS沒有發現」,下面的日誌:

GET http://localhost:8080/build/production/recommendation/.js?_dc=1431411762018 404 (Not Found) 
    Ext.Boot.Ext.Boot.d.fetch 
    Ext.Boot.Ext.Boot.r.fetch 
    Ext.Boot.Ext.Boot.r.loadSync 
    Ext.Boot.Ext.Boot.r.load 
    Ext.Boot.Ext.Boot.k.loadEntries 
    Ext.Boot.Ext.Boot.d.processRequest  
    Ext.Boot.Ext.Boot.d.loadSync 
    Ext.Boot.Ext.Boot.d.load 
    Ext.apply.loadScripts 
    Ext.apply.load  
    Ext.apply.require 
    Ext.apply.syncRequire 
    Ext.Function.o.alias 
    Ext.ClassManager.Ext.apply.create 
    Ext.ClassManager.Ext.apply.instantiateByAlias 
    Ext.apply.factory 
    Ext.cmd.derive.applyAxes 
    k 
    Ext.Configurator.configure  
    Ext.Base.r.addMembers.initConfig 
    Ext.cmd.derive.constructor  
    Ext.cmd.derive.constructor  
    ai  
    Ext.ClassManager.Ext.apply.widget 
    Ext.cmd.derive.create 
    Ext.cmd.derive.lookupComponent  
    Ext.cmd.derive.privates.prepareItems 
    Ext.cmd.derive.add  
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.constructor  
    ai  
    Ext.ClassManager.Ext.apply.widget 
    Ext.cmd.derive.create 
    Ext.cmd.derive.lookupComponent  
    Ext.cmd.derive.privates.prepareItems 
    Ext.cmd.derive.add  
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.constructor  
    ai  
    Ext.ClassManager.Ext.apply.widget 
    Ext.cmd.derive.create 
    Ext.cmd.derive.lookupComponent  
    Ext.cmd.derive.privates.prepareItems 
    Ext.cmd.derive.add  
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.constructor  
    ai  
    Ext.ClassManager.Ext.apply.widget 
    Ext.cmd.derive.create 
    Ext.cmd.derive.lookupComponent  
    Ext.cmd.derive.privates.prepareItems 
    Ext.cmd.derive.add  
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.constructor  
    ai  
    (anonymous function) 
    Ext.ClassManager.Ext.apply.create 
    Ext.cmd.derive.loginSuccess 
    Ext.widget.submit.success 
    Ext.apply.callback  
    Ext.cmd.derive.afterAction  
    Ext.cmd.derive.onSuccess 
    Ext.apply.callback  
    Ext.cmd.derive.onComplete 
    Ext.cmd.derive.onStateChange 
    Ext.Function.o.bind 
Uncaught TypeError: object is not a function 
    (anonymous function) 
    Ext.ClassManager.Ext.apply.create 
    Ext.ClassManager.Ext.apply.instantiateByAlias 
    Ext.apply.factory 
    Ext.cmd.derive.applyAxes 
    k 
    Ext.Configurator.configure  
    Ext.Base.r.addMembers.initConfig 
    Ext.cmd.derive.constructor  
    Ext.cmd.derive.constructor  
    ai  
    Ext.ClassManager.Ext.apply.widget 
    Ext.cmd.derive.create 
    Ext.cmd.derive.lookupComponent  
    Ext.cmd.derive.privates.prepareItems 
    Ext.cmd.derive.add  
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.constructor  
    ai  
    Ext.ClassManager.Ext.apply.widget 
    Ext.cmd.derive.create 
    Ext.cmd.derive.lookupComponent  
    Ext.cmd.derive.privates.prepareItems 
    Ext.cmd.derive.add  
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.constructor  
    ai  
    Ext.ClassManager.Ext.apply.widget 
    Ext.cmd.derive.create 
    Ext.cmd.derive.lookupComponent  
    Ext.cmd.derive.privates.prepareItems 
    Ext.cmd.derive.add  
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.constructor  
    ai  
    Ext.ClassManager.Ext.apply.widget 
    Ext.cmd.derive.create 
    Ext.cmd.derive.lookupComponent  
    Ext.cmd.derive.privates.prepareItems 
    Ext.cmd.derive.add  
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initItems 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.initComponent 
    Ext.cmd.derive.constructor  
    ai  
    (anonymous function) 
    Ext.ClassManager.Ext.apply.create 
    Ext.cmd.derive.loginSuccess 
    Ext.widget.submit.success 
    Ext.apply.callback  
    Ext.cmd.derive.afterAction  
    Ext.cmd.derive.onSuccess 
    Ext.apply.callback  
    Ext.cmd.derive.onComplete 
    Ext.cmd.derive.onStateChange 
    Ext.Function.o.bind 

我的ExtJS的版本是5.1,我的煎茶CMD版本是5.1.3.61。 我已經搜索了幾個小時的答案。有人建議使用'sencha應用程序構建測試',並且我也測試了構建成功。我真的不知道我的應用程序問題在哪裏!

+1

您的堆棧跟蹤的第一行有一個「推薦」類,其中'.js'在斜線後面。有可能你有拼寫錯誤嗎?或者可能缺少'require'依賴項。 – arthurakay

+0

我相信這是一些依賴缺失。問題是我不知道哪個丟失。在開發模式中沒有出現錯誤。大樓也成功了。 – happyyangyuan

+0

在開發過程中,您是否在瀏覽器控制檯中看到關於同步加載文件的日誌? – arthurakay

回答

0

我參考here找出一種方法來找到問題所在。 正如它在sencha cmd下使用'sencha app build testing'所說的那樣,並且調試測試包以找出缺失的需求。 但是我不得不在這裏提到,爲什麼它應該可以正常工作,而不需要在生產模式和測試模式下使用別名'axis.numeric','axis.category','series.bar'的類,而它卻失敗了!更糟糕的是,在生產模式下,框架反饋沒有用,但'.js'沒有發現異常!

0

我最近面臨同樣的問題。生產構建成功時,它通過它顯示.js文件404錯誤的htdocs加載它​​。

請求URL:http://localhost/TFNextGen/.js?_dc=20170420113848 狀態代碼:404未找到

的解決方案:我的視圖文件並沒有獲得包括主要門戶文件。所以我包括所有視圖相關的js文件在main.js中的視圖文件夾之後,它像魅力一樣工作