Results 1 to 8 of 8

Thread: Uncaught TypeError: Cannot call method 'derive' of undefined

  1. #1
    Sencha User
    Join Date
    Sep 2013
    Posts
    9

    Default Uncaught TypeError: Cannot call method 'derive' of undefined

    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:

      • [COLOR=red !important]Uncaught TypeError: Cannot call method 'derive' of undefined ext.js:18[/COLOR]
        • [COLOR=red !important](anonymous function)[/COLOR]
      • 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


        any suggestions as to where I should look for debugging this would be greatly appreciated!


        thanks!







  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    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.

  3. #3
    Sencha User
    Join Date
    Sep 2013
    Posts
    9

    Default

    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
    Code:
    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....

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    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.

  5. #5
    Sencha User
    Join Date
    Sep 2013
    Posts
    9

    Default

    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.

  6. #6
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    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.

  7. #7

    Default

    Were you able to solve the error. If yes then how did you solve it

  8. #8
    Ext JS Premium Member
    Join Date
    Nov 2010
    Posts
    26

    Default

    How did you solve the error ..Please I have the same thing....

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •