MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.25.0 is available! For more information about this release, check out this topic.

    SOLVED Obj.constructor is not a function

    Troubleshooting
    2
    3
    288
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • lavolp3
      lavolp3 Module Developer last edited by lavolp3

      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: {
      	},
          },
      

      How to troubleshoot modules
      MMM-soccer v2, MMM-AVStock

      S 1 Reply Last reply Reply Quote 0
      • S
        sdetweil @lavolp3 last edited by

        @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…

        Sam

        Create a working config
        How to add modules

        lavolp3 1 Reply Last reply Reply Quote 0
        • lavolp3
          lavolp3 Module Developer @sdetweil last edited by

          @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!

          How to troubleshoot modules
          MMM-soccer v2, MMM-AVStock

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy