Sencha 应用程序构建生产成功,但生产页面无法加载并出现 .js not found 错误

Sencha app build production successfully,but the production page fails to load with .js not found error

我正在使用 Extjs 5、sencha cmd 5 和 extjs sencha 图表。

我的应用程序 index.html 在 'app' 目录中工作正常,sencha 应用程序构建成功。 当我去生产包加载生产 index.html 时,控制台给我错误 '.js not found' ,日志如下:

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,我的sencha cmd版本是5.1.3.61。 我用谷歌搜索了 hours.Some 建议使用 'sencha app build testing' 的答案,我测试构建成功 too.I 真的不知道我的应用程序问题出在哪里!

我参考了 here 来找出问题所在的方法。 正如它所说,在 sencha cmd 下使用 'sencha app build testing',并调试测试包以找出缺少的要求。 但我必须在这里提到,为什么它在 devMode 下不需要别名 'axis.numeric'、'axis.category'、'series.bar' 的 class 就可以正常工作,而在生产模式下它会失败并且测试模式!更糟糕的是,在生产模式下,框架除了“.js”未找到异常之外没有任何有用的反馈!

我最近遇到了同样的问题。通过 htdocs 加载它时生产构建成功,它显示 .js 文件 404 错误。

请求URL:http://localhost/TFNextGen/.js?_dc=20170420113848 状态 Code:404 未找到

解决方案:我的视图文件未包含在主门户文件中。所以我在 main.js 中的视图文件夹中包含所有与视图相关的 js 文件,之后它像 charm

一样工作