View Full Version : [CLOSED] Cannot create an instance of unrecognized alias: widget.tbspacer

31 Oct 2012, 12:09 PM
Sencha Cmd v3.0.0.230
Ext JS 4.1.2a (which Ext.getVersion('extjs') reports as

I'm building a new Grails app with an Ext JS front end, and I've generated the skeleton of the app using sencha generate app. I've added on a bunch of stuff: views, controllers, toolbars, etc. It all works fine in dev mode. Running app build (or ant build) produces no errors, but when I try to load the app (using the stuff generated in the build directory) in my browser (Chrome) I get the following error:

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

Seems like a missing dependency. I'm not explicitly specifying "widget.tbspacer" anywhere in my code, but I am using toolbar spacers using the shortcut string.

31 Oct 2012, 2:34 PM
Yes, the auto-dependency logic does not pick up the string short-hands (such as "|" or "->"). I will open a ticket for this, but this is a tricky one. For the time being, a "requires" will be needed on the class that uses these to ensure the dependencies are known.

1 Nov 2012, 7:06 AM
Thanks, Don. I added Ext.toolbar.Spacer to the requires and that did the trick. While you're looking into this, you may want to also look into a similar issue with radio buttons: I have several forms that use a radiogroup, and I had to add Ext.form.field.Radio to the requires to get it to work.

18 Dec 2015, 10:09 AM
Is this still an issue?