• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 2.8k 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 Sep 27, 2016, 8:55 PM Aug 8, 2016, 12:16 AM

    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 Aug 8, 2016, 2:12 AM Reply Quote 0
    • G Offline
      gndimitro @gndimitro
      last edited by Aug 8, 2016, 2:12 AM

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

      S M 2 Replies Last reply Aug 8, 2016, 10:05 AM Reply Quote 0
      • S Offline
        strawberry 3.141 Project Sponsor Module Developer @gndimitro
        last edited by Aug 8, 2016, 10:05 AM

        @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
        • M Offline
          MichMich Admin @gndimitro
          last edited by Aug 9, 2016, 3:02 PM

          @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 Aug 9, 2016, 5:38 PM Reply Quote 0
          • G Offline
            gndimitro @MichMich
            last edited by Aug 9, 2016, 5:38 PM

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

            1 Reply Last reply Reply Quote 1
            • 1 / 1
            1 / 1
            • First post
              1/5
              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