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.

    Having issues loading library

    Scheduled Pinned Locked Moved Solved Development
    5 Posts 3 Posters 3.4k 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.
    • G Offline
      gndimitro
      last edited by paviro

      I’m trying to load annyang but during the loading of my module there is a failure, 404 not found.

      My module code is this:

      Module.register("jarvis", {
      
        // Required Scripts
        getScripts: function() {
      		return ["annyang.js"];
      	}
      });
      

      Any help would be appreciated, I added the library to package.json and installed it but it won’t load. I tried testing with moment.js and it worked, is there anywhere else I need to reference the library other than package.json?


      Note from admin: Please use Markdown on code snippets for easier reading!

      G 1 Reply Last reply Reply Quote 0
      • G Offline
        gndimitro @gndimitro
        last edited by

        @gndimitro Found the issue, I needed to copy the script to the vendor folder and modify the vendor.js script

        strawberry 3.141S MichMichM 2 Replies Last reply Reply Quote 0
        • strawberry 3.141S Offline
          strawberry 3.141 Project Sponsor Module Developer @gndimitro
          last edited by

          @gndimitro when you install a dependency with npm it’s not in your module folder, instead it will be in jarvis/node_modules/annyang/annyang.js

          getScripts: function() {
              return [this.file("node_modules/annyang/annyang.js")];
          }
          

          Please create a github issue if you need help, so I can keep track

          1 Reply Last reply Reply Quote 0
          • MichMichM Offline
            MichMich @gndimitro
            last edited by

            @gndimitro FYI: to install a 3rd-party module, you should never need to modify any of the core files, like vendor.js.

            G 1 Reply Last reply Reply Quote 0
            • G Offline
              gndimitro @MichMich
              last edited by

              @MichMich Thanks! I’ll fix my code accordingly so that I won’t modify vendor.js

              1 Reply Last reply Reply Quote 1

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 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