extjssencha-cmd

Errors in the build when using sencha app build


I have a simple universal app, which works just fine when tested using

sencha app watch

However, when i prepared a production/testing build version using

sencha app build testing/production

and tested it on a webserver, the errors started to come.

For example, the modern toolkit version has a form with passwordfield within and the error whown during the view instantiation is:

Uncaught Error: [Ext.createByAlias] Unrecognized alias: widget.passwordfield

Alternatively, the classic toolkit version has a simple container with layout: 'center' and the error here is:

Uncaught Error: [Ext.createByAlias] Unrecognized alias: layout.center

All this is very annoying, because it works just fine on sencha app watch.

Any ideas how to investigate this?

I'm pretty sure it is related to some sencha cmd configurations, but i have no way to find out where the problem is.


Solution

  • 1.Try to use alias:'widget.x' and make sure that the file is included also Just try to add them to requires of your main view. Whenever you are creating a instance of an object using xtype within an items array, that same class must have the fully qualified name of the class that defines that xtype.

    This one might help you, refer this link:

    Uncaught Error: [Ext.createByAlias] Cannot create an instance of unrecognized alias: widget

    2.This is because you are using layout:'center' , without adding the layout to the requires section.'Ext.layout.container.Center' to your requires section and run the appplication.

    requires:[
      'Ext.layout.container.Center'
    ]
    

    Refer this link:

    Build the application: Error: [Ext.createByAlias] Unrecognized alias: layout.center