Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8977577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:24:14+00:00 2026-06-15T19:24:14+00:00

I am trying to define a class, but when I reference it in my

  • 0

I am trying to define a class, but when I reference it in my code I get an error

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

define(['dojo', 'dijit/dijit', "dojo/_base/declare", "dijit/place"],
   function(dojo, dijit, declare, place) {

     return declare("custom.place", [place], {
       newMethod: function() { }
   });
 })

This will not work. But the following code, works fine!

define(['dojo', 'dijit/dijit', "dojo/_base/declare", "dijit/MenuItem"],
   function(dojo, dijit, declare, MenuItem) {

   return declare("custom.item", [MenuItem], {
       newMethod: function() { }
   });
})

Any help is appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:24:15+00:00Added an answer on June 15, 2026 at 7:24 pm

    Dojo classes can only extend other Dojo classes. dojo/place is not a Dojo class; it is merely an object with some function properties.

    require(["dijit/place", "dijit/MenuItem"], function(place, MenuItem) {
      console.log(typeof place);
      console.log(typeof MenuItem);
    });
    

    The above code gives the console output:

    LOG: object 
    LOG: function 
    

    If you want an object with place’s utility functions and some extra ones, you could create your own version like this:

    define(["dojo/_base/lang", "dijit/place"], function(lang, place) {
      var newMethods = {
        foo : function () {}
      };
    
      return lang.mixin(newMethods, place);
    });
    

    If you wanted to mixin place’s functionality to a Dojo class you could do it using safeMixin but I’m not sure why you would want to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build code from the nVidia 9.5 SDK but I get the
I'm trying to define base class, which contains typedef's only. template<typename T> class A
I am trying to define an abstract class that has operators to compare two
I'm stuck. I'm trying to dynamically define a class method and I can't wrap
I am trying to override a parent class method. I successfully done so. But
I have trying to define a class DS with the declaration in DS.h and
I'm trying to make a template class where one would be able to define
I'm trying to define a click handler in a Mootools class. My handler presumes
Please help me understand how to get custom class instances to access variables defined
I'm trying to access the the assets in native code from a custom WallpaperService.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.