PDA

View Full Version : Uncaught TypeError: Cannot call method 'derive' of undefined



dha
12 Nov 2013, 11:22 AM
I have an Ext App in MVC format.(ext-4.2.1.883) The code is working fine.
Currently I am trying to create 'all-classes.js' and make it production ready.

I am getting this error:




Uncaught TypeError: Cannot call method 'derive' of undefined ext.js:18 (http://venus.bluecoat.com/ext-4.2.1.883/ext.js)

(anonymous function)

The ext.js I am using is a minified version and I cannot debug.

The command I ran to create the 'all-classes.js' file:

sencha compile --cl=/home/10.8.21.35/ext-4.2.1.883/src,BC/model,BC/store,BC/view,BC/controller,app.js concat all-classes.js

Also updated the sencha cmd version to:
Sencha Cmd v4.0.0.203

Checked out this link already.. did not help :
http://www.sencha.com/forum/showthread.php?264887-Ext-4.2.1-Commercial-Ext.cmd-missing-in-Ext.js-file


(http://www.sencha.com/forum/showthread.php?264887-Ext-4.2.1-Commercial-Ext.cmd-missing-in-Ext.js-file) any suggestions as to where I should look for debugging this would be greatly appreciated!


thanks!

scottmartin
14 Nov 2013, 7:38 AM
What happens with a simple
'sencha app build'

An errors? Any rhino syntax errrors?

Do you have any warnings in your console when you run the dev version? (ext-dev.js in html)

You can also run
'sencha --debug app build' to get a more verbose output.

Scott.

dha
14 Nov 2013, 11:08 AM
Thank you so much for taking the time to respond! I have followed all your suggestions and here are the results:

Using ext-dev.js:
Uncaught TypeError: Object prototype may only be an Object or null all-classes.js:29868
Uncaught TypeError: Object [object Object] has no method 'addCls' ext-dev.js:16234






sencha --debug app build


Sencha Cmd v4.0.0.203
[DBG] Loading CommandProviders
[DBG] Scanning extensions directory /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass for extensions
[DBG] Located /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass/sencha-compass.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass/sencha-compass.jar
[DBG] get value lib/slf4j-api-1.6.6.jar lib/ant-1.8.4.jar lib/ant-launcher-1.8.4.jar for manifest class path
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass/lib/slf4j-api-1.6.6.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass/lib/ant-1.8.4.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass/lib/ant-launcher-1.8.4.jar
[DBG] Add extension classpath entry 'sencha-compass' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass/sencha-compass.jar!/
[DBG] Add extension classpath entry 'sencha-compass' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass/lib/slf4j-api-1.6.6.jar!/
[DBG] Add extension classpath entry 'sencha-compass' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass/lib/ant-1.8.4.jar!/
[DBG] Add extension classpath entry 'sencha-compass' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass/lib/ant-launcher-1.8.4.jar!/
[DBG] Scanning extensions directory /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io for extensions
[DBG] Located /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/sencha-io.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/sencha-io.jar
[DBG] get value lib/httpclient-4.2.1.jar lib/commons-logging-1.1.1.jar lib/commons-codec-1.6.jar lib/httpclient-cache-4.2.1.jar lib/httpcore-4.2.1.jar lib/httpmime-4.2.1.jar lib/slf4j-api-1.6.6.jar lib/gson-2.2.1.jar for manifest class path
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/httpclient-4.2.1.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/commons-logging-1.1.1.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/commons-codec-1.6.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/httpclient-cache-4.2.1.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/httpcore-4.2.1.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/httpmime-4.2.1.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/slf4j-api-1.6.6.jar
[DBG] loading manifest for jar /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/gson-2.2.1.jar
[DBG] Add extension classpath entry 'sencha-io' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/sencha-io.jar!/
[DBG] Add extension classpath entry 'sencha-io' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/httpclient-4.2.1.jar!/
[DBG] Add extension classpath entry 'sencha-io' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/commons-logging-1.1.1.jar!/
[DBG] Add extension classpath entry 'sencha-io' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/commons-codec-1.6.jar!/
[DBG] Add extension classpath entry 'sencha-io' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/httpclient-cache-4.2.1.jar!/
[DBG] Add extension classpath entry 'sencha-io' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/httpcore-4.2.1.jar!/
[DBG] Add extension classpath entry 'sencha-io' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/httpmime-4.2.1.jar!/
[DBG] Add extension classpath entry 'sencha-io' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/slf4j-api-1.6.6.jar!/
[DBG] Add extension classpath entry 'sencha-io' : jar:file:/home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io/lib/gson-2.2.1.jar!/
[DBG] Scanning extensions directory /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-phonegap-packager for extensions
[DBG] Scanning extensions directory /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-cordova-packager for extensions
[DBG] Scanning for plugins in folder: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass
[DBG] Scanning for plugins in folder: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io
[DBG] Scanning for plugins in folder: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-phonegap-packager
[DBG] Loading plugin: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-phonegap-packager/cmd-phonegap-packager.plugin.xml
[DBG] Scanning for plugins in folder: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-cordova-packager
[DBG] Loading plugin: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-cordova-packager/cmd-cordova-packager.plugin.xml
[DBG] Scanning for plugins in folder: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-compass
[DBG] Scanning for plugins in folder: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/sencha-io
[DBG] Scanning for plugins in folder: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-phonegap-packager
[DBG] Loading plugin: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-phonegap-packager/cmd-phonegap-packager.plugin.xml
[DBG] Scanning for plugins in folder: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-cordova-packager
[DBG] Loading plugin: /home/mhalland/bin/Sencha/Cmd/4.0.0.203/extensions/cmd-cordova-packager/cmd-cordova-packager.plugin.xml
[ERR] Command must be run from an application folder
at com.sencha.command.environment.BuildEnvironment.mustGetAppEnvironment(BuildEnvironment.java:556)
at com.sencha.command.BaseSenchaCommand.mustGetAppEnvironment(BaseSenchaCommand.java:32)
at com.sencha.command.app.AppCommands$BuildCommand.execute(AppCommands.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:174)
at com.sencha.cli.Command.dispatch(Command.java:42)
at com.sencha.cli.Commands.dispatch(Commands.java:68)
at com.sencha.cli.Commands.dispatch(Commands.java:68)
at com.sencha.command.Sencha.dispatch(Sencha.java:81)
at com.sencha.command.Sencha.main(Sencha.java:149)




sencha app build
Sencha Cmd v4.0.0.203
[ERR] Command must be run from an application folder




My app folder structure:


myprojectfolder
index.html
app.js
cssfolder
mynamespacefolder
controllerfolder
modelfolder
storefolder
viewfolder


I am loading extjs from outside the myprojectfolder.
I was running these commands from the folder 'myprojectfolder'

Waiting for you response....

scottmartin
14 Nov 2013, 11:16 AM
Uncaught TypeError: Object prototype may only be an Object or null all-classes.js:29868
Uncaught TypeError: Object [object Object] has no method 'addCls' ext-dev.js:1623


Seems like a error in your code. You will need to find the invalid assignment.



[ERR] Command must be run from an application folder


- Did you use Sencha Cmd to generate your app? ( from your structure, I suspect not )
- Do you have a .sencha DIR (meta for cmd)
- Are you running cmd from the root of your app? (same as app.js)

Scott.

dha
15 Nov 2013, 12:39 PM
Uncaught TypeError: Object prototype may only be an Object or null all-classes.js:29868
line on which error occurs ---Element.prototype.verticalStyleHooks90 = verticalStyleHooks90 = Ext.Object.chain(Element.prototype.styleHooks);
Uncaught TypeError: Object [object Object] has no method 'addCls' ext-dev.js:1623
line on which error occurs--- Ext.fly(html, '_internal').addCls(htmlCls);


--Seems to be practially impossible to find the cause of the above errors.




[ERR] Command must be run from an application folder
- Did you use Sencha Cmd to generate your app? ( from your structure, I suspect not )
--- No I did not generate my app. Hence the "sencha compile --cl=/home/mhalland/10.8.21.35/ext-4.2.1.883/src"

- Do you have a .sencha DIR (meta for cmd)
---- I have a .sencha DIR at "/ext-4.2.1.883/", but no .sencha directory inside my app folder.


- Are you running cmd from the root of your app? (same as app.js)
---yes, I am running from the same level as app.js
but I am loading extjs from an external location.

Can you give me a few reasons why this specific error would show up? I could look into those..

thanks,
dhanya.

scottmartin
15 Nov 2013, 1:04 PM
For Cmd to work correctly, you would need to generate a new app (same namespace) and then copy your code over using the correct file structure and continue.

If you do not want / need this, then simply use YUICompressor and compress the JS/CSS yourself.

UserSenchasen
21 Jan 2014, 1:10 PM
Were you able to solve the error. If yes then how did you solve it

tonvoon
27 Aug 2014, 3:18 AM
How did you solve the error ..Please I have the same thing....