Share the post "How To Fix The [Ext.Loader] “Synchronously loading … consider adding … explicitly as a require of the corresponding class” In Sencha Touch"
While this message is not really something that will affect your web app, people like me tend to see warning messages as annoying and as such will go to great lengths to find a solution that will avoid having this warning message appear in the console.
The sample below indicates an Ext.Label declaration is missing.
|
1 |
<strong><span style="color: #0000ff;">[WARN][Anonymous] [Ext.Loader] Synchronously loading 'Ext.Label'; consider adding 'Ext.Label' explicitly as a require of the corresponding class</span></strong> |
To fix this, all you need to do is go to app.js and add this class in the requires field.
|
1 |
<strong><span style="color: #0000ff;">requires: [ 'Ext.Label' ],</span></strong> |
You can also add them within your view, controller and other classes if you wish to specifically require them within those scopes. However, the global option is more hassle free.
That’s it! That should clear those warning messages.
Thank you saved my life ! it’s a little weird because it doesn’t work on views ..
Hello i’ve got the same problem, and I added the required fields inside the app.js > Ext.application
requires: [‘Ext.MessageBox’,’Ext.field.TextArea’,’Ext.field.Email’],
No more warnings but I got nothing appear from my view which i already added to my app, I get the empty fields but with no labels?!!!
Ext.define(‘GS.view.Contact’,{
extend: ‘Ext.form.Panel’,
xtype: ‘contactform’,
config: {
title: ‘Contact’,
iconCls: ‘user’,
items:[
{
xtype: ‘textfield’,
name: ‘name’,
lable: ‘Name’
},
{
xtype: ’emailfield’,
name: ’email’,
lable: ‘Email’
},
{
xtype: ‘textareafield’,
name:’message’,
lable: ‘Message’
}
]
}
}
);
@ola: perhaps maybe because you misspelled label with lable?