MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Obj.constructor is not a function

    Scheduled Pinned Locked Moved Solved Troubleshooting
    3 Posts 2 Posters 558 Views 2 Watching
    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.
    • lavolp3L Offline
      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 Away
        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

        How to add modules

        learning how to use browser developers window for css changes

        lavolp3L 1 Reply Last reply Reply Quote 0
        • lavolp3L Offline
          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 Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy