问题
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!
回答1:
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!
回答2:
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
来源:https://stackoverflow.com/questions/30183658/sencha-app-build-production-successfully-but-the-production-page-fails-to-load-w