-
2 Mar 2013 9:45 AM #1
Hard to compile project, any help appreciated. Sending beers.
Hard to compile project, any help appreciated. Sending beers.
Hi all,
Hopefully somebody can help me with this puzzle.
$ uname -a
Darwin MBP.local 12.2.1 Darwin Kernel Version 12.2.1: Thu Oct 18 16:32:48 PDT 2012; root:xnu-2050.20.9~2/RELEASE_X86_64 x86_64
$ sencha
Sencha Cmd v3.0.2.288
ExtJS: 4.1.1.1
Project structure:
/application
+views/interface.php
/htdocs
+app.js
+app/
+-modules/
+-module1
|+component1/MVCS
|+component2/MVCS
+-module2
+libs/
+-ext4/
+-ext_ux/
My application classes are defined like so: MYNS.modules.module1.component1.view.Component
interface.php plays the role of index.hmtl in regular application, this is due to application being protected with authentication(regular html form) after successfull authentication the user is redirected to the interface view (codeigniter on the backend).
Everything works fine in the browser, the loader picks all files and the application runs fine.
Attempting to produce concatenated output dies pretty fast with unable to find file.
Here is my loader configuration:
This is the CMD output:Code:Ext.Loader.setConfig({ enabled: true, paths: { 'Ext': '/libs/ext4/src', 'Ext.ux': '/libs/ext4_ux' } });
[ERR] Failed to resolve dependency Object for file Ext.ux.ToolbarDroppable
[ERR] Error executing page compilation Unknown definition for dependency : Object
[ERR] com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Object
Any help appreciated.
Thank you
-
2 Mar 2013 9:18 PM #2
Sencha Cmd operates on a "class path" concept to resolve code. These paths are configured in your application's .sencha/app/sencha.cfg file.
From what you have posted, it looks like you might need this in your sencha.cfg:
Given the above, the bootstrap.js file produced by sencha app refresh should provide the Loader with all the configuration it needs and you should not need code in your application to configure the loader paths.Code:app.classpath=${app.dir}/app.js,${app.dir}/app,${app.dir}/libs/ext4_ux
This is covered in more detail here - http://docs.sencha.com/ext-js/4-1/#!/guide/command_appDon Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
3 Mar 2013 2:48 AM #3
Hi and thanks for the reply.
I dont have .sencha directory in my project because it wasn't created with sencha cmd, I am trying to only compile it by sending --classpath as parameter like so:
And this is the output:Code:$ sencha compile --classpath htdocs/libs/ext4/src,htdocs/libs/ext4_ux/,htdocs/app/* page -yui -in htdocs/application.js -out build/allclasses.js
Any help appreciated.Code:Sencha Cmd v3.0.2.288 [INF] Compiling page null [INF] Processing classPath entry : /_projects/project/sencha-compile-temp-dir [INF] Processing classPath entry : htdocs/libs/ext4/src [INF] Processing classPath entry : htdocs/libs/ext4_ux/ [INF] Processing classPath entry : htdocs/app/* [INF] Processing class inheritance graph [ERR] Failed to resolve dependency Object for file Ext.ux.ToolbarDroppable [ERR] Error executing page compilation Unknown definition for dependency : Object [ERR] com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Object
-
3 Mar 2013 7:44 PM #4
Do you see a "ux" folder with a "ToolbarDroppable.js" file in ext4_ux? The error is due to that class not being found though it looks like it should be given your classpath. You can enable the "-debug" log level and see if that provides you with any clues on that missing class.
If you want to experiment with leveraging the generated app build process, you can generate one and copy its ".sencha" folder and build.xml to your app. You would have to change the config values to match your app so the benefits of doing so depend on how closely your app mirrors the structure of Cmd-generated apps.Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
3 Mar 2013 7:46 PM #5
Also, you should not need an "*" in your classpath - just a list of files and folders. Folders are automatically assumed to be "*.js" and all subfolders are scanned as well.
Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
4 Mar 2013 8:47 PM #6
Are you sure that you want the 'compile page' command here? The 'page' command works on html files as input and output, but you are referencing js files?
What happens when you use
That assumes that application.js is a standard javascript file that defines your 'entry point' dependencies in any way supported by the compiler. 'union -r -f application.js' will include application.js and all its dependencies (recursively).Code:sencha --classpath htdocs/application.js,[your other paths] compile union -r -f application.js and concat -strip -compress build/allclasses.js
-
6 Mar 2013 2:51 AM #7
Thank you both for the attention. I believe that I am slowly starting to understand the situation.
@mberrie thank you for clarifying the sencha cmd mysterious keys and options, it makes a lot more sense to me now. BTW the 'compile' should be between sencha and --classpath, right?
However I am still not able to compile the application, what I have figured out to be the problem so far is the fact that some components extend on 'Object' and sencha cmd is looking for file Object.
PHP Code:Ext.define('Ext.ux.ToolbarDroppable', {
extend: 'Object',
I cannot find file Object.js in the extjs distribution. However it is present in the documentation http://docs.sencha.com/ext-js/4-1/#!/api/ObjectPHP Code:[ERR] Failed to resolve dependency Object for file Ext.ux.ToolbarDroppable
And the Object.js file is one big comment.
Is is possible this to be somekind of CMD bug??
Thanks
-
6 Mar 2013 8:23 AM #8
'Object' in the docs is referring to the Object defined by the JavaScript (EcmaScript) standard. There is no actual corresponding 'Object.js' file in the ExtJs framework (maybe there is one in JsDuck holding the meta data required for the docs to generate).
Just drop the 'extend' entirely if you don't need a specific super class - all Objects in JavaScript derive from the standard Object anyway.
Code:Ext.define('Ext.ux.ToolbarDroppable', { }
-
6 Mar 2013 8:47 AM #9
Hi,
This is exactly what I did.
Then had to play with the command you gave me as it seems cmd 3 is different.
Here what did the job for me:
[PHP]Hi,
This is exactly what I did.
Then had to play with the command you gave me as it seems cmd 3 is different.
Here what did the job for me:
However the build does not work because of singleton class of my own is messing things.. I have to look into it.PHP Code:sencha -debug compile --classpath htdocs/application.js,\
htdocs/app,\
htdocs/libs/ext4/src,\
htdocs/libs/ext4_ux,\
htdocs/libs/ext4_overwrite \
union -r -f application.js \
and concatenate -co -str -output-file htdocs/build/allclasses.js
Please send me your mailing address on PM to send you the beers.
Thanks again.
However the build does not work because of singleton class of my own is messing things.. I have to look into it.
Please send me your mailing address on PM to send you the beers.
Thanks again.
-
6 Mar 2013 8:54 AM #10
Haha. It's ok. And I doubt it's worth to send them to Thailand
But I guess Don could really need a beer or two once in a while!
Btw, glad you figured it out
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote