Read the statement by Michael Teeuw here.
Having issues loading library
-
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!
-
@gndimitro Found the issue, I needed to copy the script to the vendor folder and modify the vendor.js script
-
@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")]; }
-
@gndimitro FYI: to install a 3rd-party module, you should never need to modify any of the core files, like vendor.js.
-
@MichMich Thanks! I’ll fix my code accordingly so that I won’t modify vendor.js