Elbassel
Elbassel

Reputation: 454

Uncaught Error: declare: mixin #0 is not a callable constructor

I'm using the following code:

require([
    "dojo/_base/declare",
    "dojo/ready", 
    "dijit/registry", 
    "dojox/mobile/ListItem",
    "dojox/mobile/EdgeToEdgeList",
    "dojo/dom-construct",
    "dojox/mobile/ProgressBar",
    "dojo/parser", 
    "dojox/mobile",
    "dojox/mobile/compat", // For non-webkit browsers (FF, IE)
    "dojox/mobile/ScrollableView"
], function(declare, ready, registry, ListItem, LongListMixin,
    EdgeToEdgeList, domConstruct, ProgressBar) {

    ready(function() {
        console.log("inside init Videos2");
        mainRegistry = registry;
        scrollableListItem = ListItem;
        ..........

I got the following error:

Uncaught Error: declare: mixin #0 is not a callable constructor.

Upvotes: 1

Views: 5353

Answers (2)

pdschuller
pdschuller

Reputation: 584

For me that error meant that a file in my require list was bogus. Meaning that dojo just couldn't work with it. It was a file I had created. Once I got that out of there the error went away and I got the results I wanted.

Upvotes: 2

Dimitri Mestdagh
Dimitri Mestdagh

Reputation: 44745

I assume you're using the dojox/mobile/LongListMixin somewhere to add as a mixin. The problem is that you're not including that module in your require() list.

According to your parameters, you want the LongListMixin between dojox/mobile/ListItem and dojox/mobile/EdgeToEdgeList. Add it there so your require() becomes:

require([
    "dojo/_base/declare",
    "dojo/ready", 
    "dijit/registry", 
    "dojox/mobile/ListItem",
    "dojox/mobile/LongListMixin", // This was missing
    "dojox/mobile/EdgeToEdgeList",
    "dojo/dom-construct",
    "dojox/mobile/ProgressBar",
    "dojo/parser", 
    "dojox/mobile",
    "dojox/mobile/compat", // For non-webkit browsers (FF, IE)
    "dojox/mobile/ScrollableView"
], function(declare, ready, registry, ListItem, LongListMixin,
    EdgeToEdgeList, domConstruct, ProgressBar) {

    // ...

});

If you don't add it, the next parameter in the list (the dojox/mobile/EdgeToEdgeList) is being mapped to the LongListMixin parameter, causing errors because that isn't really expected.

Upvotes: 2

Related Questions