-
4 Oct 2012 2:49 PM #1
Build error with custom app path
Build error with custom app path
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.1rc1
Browser versions tested against:- N/A
DOCTYPE tested against:- html
Description:- If you create an app using Sencha Command, the app's classes are stored in an "app" folder. In previous versions of the command, you could customize this folder. Now I get an error when I try to build an app with a custom folder.
Steps to reproduce the problem:- Run "sencha generate app ..." to create an app.
- In app.js, change the "Ext.Loader.setPath" command. Instead of 'default': 'app', use 'default': 'customfolder'.
- Rename the "app" folder to "customfolder".
- Run "sencha app build production".
The result that was expected:- Builds correctly.
The result that occurs instead:- Shows the following output:
Code:Sencha Cmd v3.0.0.188 [INFO ] init-properties: [INFO ] init-sencha-command: [INFO ] init: [INFO ] -before-app-build: [INFO ] app-build-impl: [INFO ] building application [INFO ] Deploying your application to /Users/myuser/test/build/default/production [INFO ] Copied app.js [INFO ] Copied resources/css/app.css [INFO ] Copied /Users/myuser/test/resources/icons [INFO ] Copied /Users/myuser/test/resources/startup [INFO ] Resolving your application dependencies (file:////Users/myuser/test/index.html) [INFO ] Compiling app.js and dependencies [INFO ] Processing classPath entry : /Users/myuser/test/sencha-compile-temp-dir [INFO ] Processing classPath entry : /Users/myuser/test/touch/src [INFO ] Processing classPath entry : /Users/myuser/test/app.js [INFO ] Processing classPath entry : /Users/myuser/test/app [WARN ] [ [1000] : Yui Compressor Warning <> Trailing comma is not legal in an ECMA-262 object initializer => }, function() { ] :: ( /Users/myuser/test/touch/src/app/Controller.js => 625 : 1 ) [ERROR] def was null [ERROR] failed to find meta class definition for name default.view.Main [ERROR] Exception running app build : JavaException: com.sencha.exceptions.BasicException: null [ERROR] javax.script.ScriptException: sun.org.mozilla.javascript.internal.JavaScriptException: [object Error] (<Unknown source>#709) in <Unknown source> at line number 709 - Also note the warning from YUI compressor.
Test Case:
See above.
HELPFUL INFORMATION
Screenshot or Video:- N/A
See this URL for live test case: N/A
Debugging already done:- Also tried adding "appFolder": "customfolder" to the app config, but got the same result.
Possible fix:- not provided
Additional CSS used:- only default ext-all.css
Operating System:- Mac OS 10.8.2
-
4 Oct 2012 3:03 PM #2
Actually, I'm getting a similar error when I include any classes with a custom directory. Makes me think I must be doing something wrong, but I'm not sure what. For example, in app.js, I added the following to the template app:
Then I added a file dummy/Sample.js, containing a definition of dummy.Sample. When I try to build it, I get:Code://<debug> Ext.Loader.setPath({ 'Ext': 'touch/src', 'dummy': 'dummy', 'default': 'app' }); //</debug> Ext.application({ name: 'default', requires: [ 'dummy.Sample', 'Ext.MessageBox' ],
All of this works when I'm debugging in a browser, but fails when I try to build.Code:[INFO ] Processing source dependencies [ERROR] Failed to find file for dummy.Sample required by /Users/myuser/test/app.js [ERROR] Exception running app build : JavaException: com.sencha.exceptions.ExBuild: Failed to find any files for dummy.Sample [ERROR] javax.script.ScriptException: sun.org.mozilla.javascript.internal.JavaScriptException: [object Error] (<Unknown source>#709) in <Unknown source> at line number 709
-
5 Oct 2012 8:53 AM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
Thanks for the report! I have opened a bug in our bug tracker.
-
12 Oct 2012 9:02 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Using v3.0.0.190 with ST 2.1.0 RC1 I can change the app dir to something else and get it to build properly. Here is how I did it:
> cd /path/to/sencha-touch-2.1.0-rc1
> sencha generate app MyApp /path/to/MyApp
> cd /path/to/MyApp
> mv app foo
-- edit app.js to have MyApp path resolve to the foo directory
--edit .sencha/app/sencha.cfg and change this line:
toCode:app.classpath=${app.dir}/app.js,${app.dir}/app
> sencha app build productionCode:app.classpath=${app.dir}/app.js,${app.dir}/foo
This should build fine and you can launch your app in a browser just fine.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
12 Oct 2012 9:51 AM #5
Thanks. That works, but this is an area where the documentation really needs improvement.
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote