Results 1 to 2 of 2

Thread: ExtJS parsenamespace returning undefined

  1. #1

    Join Date
    Nov 2012
    Location
    Cheshire
    Posts
    45
    Answers
    2

    Default ExtJS parsenamespace returning undefined

    I have been getting a number of errors, when running a production compiled app from Sencha Architect.

    Code:
    Uncaught TypeError: undefined is not a function
        Ext.ClassManager.parseNamespace
        Ext.ClassManager.isCreated
        Ext.apply.require
        (anonymous function)
        Ext.apply.doProcess
        Ext.apply.process
        Ext.Class.c
        Ext.ClassManager.create
        Ext.apply.defineRating.js 
        (anonymous function)

    I have added some debug output to the class source, so that when Architect builds it the debug is compiled as part of the production code.


    Which displays the following


    Code:
    ["Ext.form.field.Number"]
        Ext.form.field.Number       <- this is the class to lookup possible classname expressions from
        [Array[2]]
        [Array[2]]
           0: Array[2]              <- returns an array of 2, where 1: = undefined.
           0: "Ext.form.NumberField"
           1: undefined
           length: 2
           __proto__: Array[0]
           length: 1
           __proto__: Array[0]
        Object {p: Array[0], r: Array[1], root: Window, n: Array[2]}
    This debug is added to the function Ext.Loader.require, just before the iteration on line:981

    Code:
    scope = scope || Ext.global;
                console.log("Class Loader expressions");
                console.log(expressions);
                for (i = 0,ln = expressions.length; i < ln; i++) {
                    expression = expressions[i];
                    console.log(":::");
                    console.log(expression);
                    if (typeof expression == 'string' && expression.length > 0) {
                        possibleClassNames = Manager.getNamesByExpression(expression);
                        subLn = possibleClassNames.length;
                        console.log(possibleClassNames);
                        for (j = 0; j < subLn; j++) {
                            possibleClassName = possibleClassNames[j];
                            console.log(possibleClassNames);
    All this suggests to me that there are core class elements which are returning an undefined value for a class name. Yet Sencha Architect should/does do most of the heavy lifting when linking up class names.
    When the application is compiled using develop option then the application works as expected and does not throw any errors.

    This error is being thrown regardless if the controller is loaded dynamically or if it is included above Ext.onReady().

    Also I have included quite a few of the core components in Ext.application

    Code:
    Ext.application({
    
      requires: [
        'Ext.Loader',
        'Ext.panel..*',
        'Ext.button.*',
        'Ext.grid.*',
        'Ext.toolbar.*',
        'Ext.tip.*',
        'Ext.window.*',
        'Ext.dd.*',
        'Ext.chart.*',
        'Ext.util.*',
        'Ext.tree.*',
        'Ext.menu.*',
        'Ext.layout.*',
        'Ext.form.*'
      ],
    I'm not quite sure where to look now as it seems to be occurring on the loading of core Ext components.
    Does anyone have any suggestions of where I should be looking?

    Further investigations seems to show that Ext.form.field.base is causing this. When debugging the Class Manager function getNameByAlternate to list the current
    Code:
    this.maps.getNameByAlternate
    The alternate names for Ext.form.field.Base contains an undefined value, this seems to be propagated to the child classes.
    Code:
    Ext.form.FileUploadField
    which is also a child class, has two undefined values which correspond to:
    Code:
    Ext.form.File
    Ext.ux.form.FileUploadField
    
    So somewhere these are either not getting added from Ext.form.* or something else.
    Last edited by richard.styles; 6 Jan 2015 at 1:54 AM. Reason: more infomation

  2. #2
    Sencha Premium User lumberjack's Avatar
    Join Date
    Nov 2014
    Location
    Kansas
    Posts
    781
    Answers
    102

    Default

    What version of Ext JS is in use in your project?

    Regards,
    Brian

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
  •