MagicMirror² v2.12.0 is available! For more information about this release, check out this topic.

Obj.constructor is not a function


  • Module Developer

    Hi all,

    I have programmed a new module and get this error message in the browser:

    class.js:79 Uncaught TypeError: obj.constructor is not a function
        at cloneObject (class.js:79)
        at cloneObject (class.js:81)
        at Function.Module.create (module.js:435)
        at afterLoad (loader.js:122)
        at loader.js:137
        at HTMLScriptElement.script.onload (loader.js:184)
    

    This comes up directly after

    Module registered: MMM-testmodule
    

    The mirror then does not start.
    When I disable the module in the config, the message vanishes and the mirror starts properly.

    Never seen that before. Does anybody know where this comes from?

    Config entry:

        {
            //disabled: true,
            module: "MMM-testmodule",
            position: 'top_left',
            config: {
    	},
        },
    


  • @lavolp3 no… can u post your module on gh so I can download it?

    I created a small sample, using same names… it loaded ok…

    but the js file has no useful content…


  • Module Developer

    @sdetweil I have found the problem.

    I had implemented an emtpy Object in the main module:

    Module.register("MMM-testmodule", {
    
      defaults: {
        ...    
      },
    
      loading: true,
      fetchedData: Object.create(null),
    

    It didn’t like the Object for some reason.
    But thanks Sam for offering help! You’re a real lighthouse around here!


Log in to reply