lundi 5 janvier 2015

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?



ExtJS parsenamespace returning undefined

Aucun commentaire:

Enregistrer un commentaire