-
29 Nov 2012 9:21 AM #1
SenchaCmd 3.0.0.250 issues with Ext.Loader
SenchaCmd 3.0.0.250 issues with Ext.Loader
This problem has been solved. Solution in Post #6.
In short, my application works great with Ext.Loader enabled but not built. However, after disabling Ext.Loader and building my application, it continues to try and load every file that has already been defined in single file that SenchaCmd compiled. It tries to load all of the files with an incorrect path and thus fails.
How can I stop my built, single js file from using Ext.Loader to load all of my classes? All of the classes are already defined in the single js file, but Loader doesn't seem to either notice or care that literally the entire application has already been loaded.
Here's what's happening in Firebug (this is a snippet... it goes on for much longer):
I don't know why it's using NS as the path, as that should have translated to "app".Code:Error: [Ext.Loader] Failed loading 'NS/controller/Authentication.js', please verify that the file existsError: [Ext.Loader] Failed loading 'NS/controller/User.js', please verify that the file exists Error: [Ext.Loader] Failed loading 'NS/store/Users.js', please verify that the file exists Error: [Ext.Loader] Failed loading 'NS/view/UserEditor.js', please verify that the file exists
I have been working on this for days and any help would be appreciated. Thanks!Last edited by krullj; 3 Dec 2012 at 9:23 AM. Reason: Used "However" too many times.
-
30 Nov 2012 2:58 AM #2
Need more code
Need more code
Just to investigate your problem please post the app.js code.
-
30 Nov 2012 6:35 AM #3
Make sure the single file really has all of the classes in it. I just had an issue recently where only the Views were getting combined into the single file and the loader was trying to load each individual Controller file. None of the controllers, stores or models were compiled into the single file.
Between all the stuff I tried I think the two things that worked were:
Refreshing the bootstrap.js:
And I had to include the app.js in the compile:Code:sencha app refresh
This compiled all the app only files into the single appClasses.js and the loader worked fine after that.Code:sencha compile -classpath=ext/src,app,resources,app.js page -name=page -in index.html -out=deploy/index.html and restore page and exclude -file ext/src and concat deploy/appClasses.js
-
30 Nov 2012 10:37 AM #4
Thank you for the responses.
In terms of using
I am unable to do that as the application was not initially created with SenchaCmd. If there's a way to force the refresh, I'm not sure how to do it.Code:sencha app refresh
I did try creating a bootstrap.js file manually by using the following code:
But when using the bootstrap it never seemed to make a difference error-wise. Ext.Loader was still trying to load all of the classes that were already defined in the single built js file. Maybe I'm building the bootstrap incorrectly; that I'm not sure of.Code:sencha compile --classpath=ext/src,ext/examples/ux,app,app.js meta -loader-paths -base-path . -out bootstrap.js and meta -alternates -append -out bootstrap.js and meta -alias -append -out bootstrap.js
As far as I can tell, every view, controller, model, etc are listed in the single built js file, including the ones that it tries to load.
-
2 Dec 2012 1:30 AM #5
Recreate app with CMD
Recreate app with CMD
I had an app not created by CMD. So I recognise the problem build the app. I generated an with the same name and copied all js, css, html, custom pics etc into the new empty app. After that I had no more problems with run CMD commands on the app. Be aware of that generate an app with the same name could overwrite the old one. So move the old app to another map before generate an empty new with the same name.
-
3 Dec 2012 9:09 AM #6
Fixed It
Fixed It
I finally found the solution to be, in my case, this:
Essentially, I specified the order of the class files and put the "controller" folder at the end. I honestly hope there is a better solution than this, but it worked for me.Code:sencha compile --classpath=ext/src,ext/examples/ux,app/model,app/store,app/view,app/controller,app/app.js union -recursive -file app/app.js concat all-classes.js
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote