30 May 2011 3:23 AM #1
Strange behaviour, load page : Errors, reload multiple times :Errors, reload -> fine
I am working on a project and found something I cannot explain.
I am using MVC with an application setup. I'm on a mac and use Safari by default.
I have Ext.loader setup and when I load the page (index.html in the App directory)
[Ext.Loader] Synchronously loading 'Affiliation.store.SearchCustomer'; consider adding Ext.require('Affiliation.store.SearchCustomer') above Ext.onReady
ext-all-debug.js:3719[Ext.Loader] Synchronously loading 'Affiliation.view.TelephoneNumberForm'; consider adding Ext.require('Affiliation.view.TelephoneNumberForm') above Ext.onReady
ext-all-debug.js:5477Cannot create an instance of unrecognized class name / alias: Affiliation.view.TelephoneNumberForm
ext-all-debug.js:4797Uncaught Ext.Error: Cannot create an instance of unrecognized class name / alias: Affiliation.view.TelephoneNumberForm
ext-all-debug.js:5477The following classes are not declared even if their files have been loaded: 'Affiliation.view.CustomerTab'. Please check the source code of their corresponding files for possible typos: 'app/view/CustomerTab.js'
ext-all-debug.js:4797Uncaught Ext.Error: The following classes are not declared even if their files have been loaded: 'Affiliation.view.CustomerTab'. Please check the source code of their corresponding files for possible typos: 'app/view/CustomerTab.js'
I have tested with Chrome and get exactly the same.
If I use Firefox however I do not see this behavior.
This might be webkit related but it drive me nuts.
Does anyone see this?
13 Jun 2011 12:44 AM #2
I had same problem, but with Firefox, all worked in Chrome. I got error:
Cannot create an instance of unrecognized class name / alias: Ext.ux.data.reader.Json
For me, adding
requires: [ 'Ext.ux.data.reader.Json' ]
13 Jun 2011 3:07 AM #3
I poked around with Ext.require too and suddenly I never saw this behavior again.
Due to me having a fairly complex Application setup, I found the location of Ext.require to be Important. I guess learning how to coop with application i.c.w. MVC is harsh.
The strange errors you get are not making it easier.
Anyway. I just wanted to update this thread to confirm Ext.require and the location of it are important.
I think I saw a "require" config option for Ext.define. that might very well be a better solution (for reusing code pieces) since the requirements/dependancies are then coupled to the actual object definition.