Search code examples
buildsencha-cmddev-to-production

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


I am using Extjs 5 ,sencha cmd 5 and extjs sencha charts.

My app's index.html in the 'app' directory works fine,and sencha app build successfully. When I go to the production package to load the production index.html,the console gives me the error '.js not found' ,the log below:

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   

My Extjs version is 5.1,my sencha cmd version is 5.1.3.61. I have googled answers for hours.Some advised to use 'sencha app build testing',and I testing build successfully too.I really don't know where my app problem is!


Solution

  • I referred here to find out a way to locate where the problem is. As it said using 'sencha app build testing' under sencha cmd,and debug the testing package to find out the missing requires. But I have to mention here that, Why should it work fine without requiring the class with alias 'axis.numeric','axis.category','series.bar' under devMode, while it fails under production mode and testing mode! Even worse,under production mode the framework feeds back nothing useful but a '.js' not found exception!