2015-05-12 53 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中的视图文件夹之后,它像魅力一样工作