0

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!

happyyangyuan
  • 179
  • 3
  • 14
  • 1
    The first line of your stack trace has a "recommendation" class, in which the `.js` is after a slash. Is it possible you have some misspelling? Or maybe a `require` dependency is missing. – arthurakay May 12 '15 at 12:35
  • I am sure it is some dependencies are missing. The problem is i don't know which is missing. No error shows up in develop mode. And the building succeeded too. – happyyangyuan May 12 '15 at 16:03
  • In development, do you see any logs in your browser console about loading files synchronously? – arthurakay May 12 '15 at 16:06
  • Finally,I found out what's missing! Just debug under testing package.I am using the sencha bar charts,I have added requires the 'sencha charts' package to app.son, and under developing mode, it works fine without requiring the 'axis.numeric','axis.category','series.bar' etc...These errs all came up in testing mode! – happyyangyuan May 13 '15 at 16:19

2 Answers2

0

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!

Community
  • 1
  • 1
happyyangyuan
  • 179
  • 3
  • 14
0

I was facing the same issue recently. Production build was successful while loading it through htdocs it was showing .js file 404 error.

Request URL:http://localhost/TFNextGen/.js?_dc=20170420113848 Status Code:404 Not Found

solution : my view files were not getting include in main portal file. so i include all the view related js files from view folder in main.js after that it work like charm

mugdha
  • 3
  • 4