Uncaught TypeError: Object function () { var FinalCtor; // check for cached final constructor first, used mainly when // developers directly use kind names in their components instead of // strings that are resolved at runtime. if (DeferredCtor._FinalCtor) { FinalCtor = DeferredCtor._FinalCtor; } else { if (!(this instanceof DeferredCtor)) { throw "enyo.kind: constructor called directly, not using 'new'"; } FinalCtor = DeferredCtor._finishKindCreation(); } var obj = enyo.delegate(FinalCtor.prototype); var retVal = FinalCtor.apply(obj, arguments); return retVal? retVal: obj; } has no method 'subclass'Popup demos in the samples folder work perfectly using the same version of enyo and onyx.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I just went over the code that sets that base property, and it's always a direct kind reference, produced by a call to enyo.constructorForKind() which will undef anything passed in. So, having some .base reference to a deferred kind is very puzzling to me.
Maybe this could happen if you redefine a kind after its been used, but even then, I that shouldn't alter the base reference that's already been established.
As a work around, you can also turn off deferral globally by adding the line in your index.html before you include enyo.js. However, I'd really like to understand why this is happening for you.
For that view, any onyx component you add will fail (in fact, any component "path" string, like "enyo.Button"). For child kinds defined _outside_ of that view (I mean using enyo.kind()) everything works as expected.
Sadly, because I find registerTheme() pretty useful to save some characters. In fact, I think it should be called automatically when loading onyx. It's cool to have everything onyxified (or whateverfied) with just a a single line.
Seems like the application view components are the only ones ones that get instantiated before undeferred.
The problem ended up being an unintentional recursion with onyx.Popup. The kind was specified with a base of just "Popup", not "enyo.Popup". This meant that when the OOP code tried to undefer onyx.Popup, it found the base name on the registered theme, so make the in-process onyx.Popup the base of itself. That's bad.
Forget changing ViewController... the real fix is in Popup.js in onyx, changing kind: "Popup" to kind: "enyo.Popup".
(Code change reviewed and pulled at https://github.com/enyojs/onyx/pull/181)