Read the statement by Michael Teeuw here.
Modules won't show up on mirror?
-
@Mykle1
I tried following this and got a config.js error
I copied my code into Esprima syntax validator and it is giving me an “Unexpected token” error for line 3, which denotes the position specification. Any ideas? -
I wouldn’t know without seeing it, but you’re missing the beginning of your config.js if
position: 'top_left',
is line 3.var config = { address: "localhost", port: 8080, ipWhitelist: [], language: "en", timeFormat: 12, units: "imperial", modules: [ { module: 'MMM-voice', position: 'bottom_bar', config: { microphone: 2, } },
-
@bmbaugh said in Modules won’t show up on mirror?:
I tried adding it to the array in config.js but nothing showed up, any ideas?
Every bracket closed correctly? Commas used correctly? I’d also like to see the config.js.
You can also start the software with npm start dev to have a look at the console, often it tells you what is wrong. -
For some reason when I edited the actual config.js in text editor it worked! (as opposed to editing the document within Terminal)
Thank you!!
-
nano? In the terminal, you have to use “sudo nano” to get rights to write to the file.
-
This post is deleted! -
Can you edit that and put the tags for code around it?
-
@doubleT Ill repost it. for whatever reason it was flagged as spam
-
/* Magic Mirror Config Sample * * By Michael Teeuw http://michaelteeuw.nl * MIT Licensed. * * For more information how you can configurate this file * See https://github.com/MichMich/MagicMirror#configuration * */ var config = { address: "localhost", // Address to listen on, can be: // - "localhost", "127.0.0.1", "::1" to listen on loopback interface // - another specific IPv4/6 to listen on a specific interface // - "", "0.0.0.0", "::" to listen on any interface // Default, when address config is left out, is "localhost" port: 8080, ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses // or add a specific IPv4 of 192.168.1.5 : // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"], // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format : // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"], language: "en", timeFormat: 12, units: "imperial", modules: [ { module: "clock", position: "top_left", }, { module: "alert", }, { module: "updatenotification", position: "top_center" }, { module: "calendar", header: "US Holidays", position: "top_right", config: { calendars: [ { symbol: "calendar-check-o ", url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics" } ] } }, { module: "compliments", position: "lower_third" }, { module: "currentweather", position: "bottom_right", config: { location: "New York", locationID: "", //ID from http://www.openweathermap.org/help/city_list.txt appid: "YOUR_OPENWEATHER_API_KEY" } }, { module: "weatherforecast", position: "top_right", header: "Weather Forecast", config: { location: "New York", locationID: "5128581", //ID from http://www.openweathermap.org/help/city_list.txt appid: "YOUR_OPENWEATHER_API_KEY" } }, { module: "newsfeed", position: "bottom_bar", config: { feeds: [ { title: "New York Times", url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml" } ], showSourceTitle: true, showPublishDate: true } }, ] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") {module.exports = config;}
-
(and nested objects and arrays). The last property never gets a comma, these are only separators.That’s probably it. The developer console would probably have hinted at that, saying something like the next thing after the comma was expected to be something else.
While you’re removing the last comma in the clock module’s settings, also remove the three empty lines that follow.
{ module: "clock", position: "top_left" // no comma },
another example:
{ module: "clock", position: "top_left", // comma, because "config" follows config: { displayType: "digital" // no comma } // no comma },