Read the statement by Michael Teeuw here.
Need help with Config.js!
-
Hello all!
I’ve finally taken the plunge and started on my mirror. I got it up and running now with the basic defaults but wanted to add a few modules and update some default module configurations.
I have a working Config.js but when I swap in my new additions it ceases to work and gives me a “Please create a Config” message.
I’ve ran my config through JSHint but it’s not giving me any useful errors!
Please see my config below and let me know what I’m doing wrong. I’m pretty sure it’s something with the compliments module.
Thanks!
language: "en", timeFormat: 12, units: "imperial", modules: [ { module: "alert", }, { module: "updatenotification", position: "top_bar" }, { module: 'MMM-Remote-Control', // uncomment the following line to show the URL of the remote control on the mirror position: 'bottom_left' // you can hide this module afterwards from the remote control itself }, { module: "clock", position: "top_left" }, { module: "calendar", header: "Upcoming", position: "top_left", config: { calendars: [ { symbol: "calendar-check-o ", url: "xxxx" } ] } }, { module: "compliments", position: "lower_third", config: { compliments: { anytime: [ "Hi there!", "I love you!", "You look great!", "You can do anything!", "Don't forget your keys!" ], morning: [ "Good morning beautiful!", "Good morning handsome!", "You is an icon", "Enjoy your day!" ], afternoon: [ "Looking good!", "You look nice!", "Have a good one!" ], evening: [ "Wow, you look great!", "Good evening!" ], rain: [ "Stay dry!", "Grab a jacket!" ], showers: [ "Stay dry!", "Grab a coat!" ], day_sunny: [ "Suns out, guns out!", "It's sunny! Go to a park!", "It's a beautiful day!" ] } } }, { module: "currentweather", position: "top_right", config: { location: "Seattle", locationID: "5809844", //ID from http://www.openweathermap.org/help/city_list.txt appid: "xxxx", roundTemp: "true" } }, { module: "weatherforecast", position: "top_right", header: "Weather Forecast", config: { location: "Seattle", locationID: "5809844", //ID from http://www.openweathermap.org/help/city_list.txt appid: "xxxx", roundTemp: "true" } }, { module: "newsfeed", position: "bottom_bar", config: { feeds: [ { title: "New York Times", url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml" } { title: "Reuters", url: "http://feeds.reuters.com/reuters/topNews" } { title: "Google News" url: "https://news.google.com/news/rss/?ned=us&gl=US&hl=en" } ], showSourceTitle: true, showPublishDate: true } }, ] };
-
You are missing a comma
{ title: "Google News", // ADD a comma here url: "https://news.google.com/news/rss/?ned=us&gl=US&hl=en" }
-
@Charley Thanks!
I added the comma and restarted and I still am getting the error. -
The best way is to comment out a module and restart the mirror if the error persists than it is another module.
-
You missed 2 or 3 commas in newsfeed module. The comma Charley spotted, and 2 commas after each newsfeed { }
This is passing jshint without any error.
/* 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: "alert", }, { module: "updatenotification", position: "top_bar" }, { module: 'MMM-Remote-Control', // uncomment the following line to show the URL of the remote control on the mirror position: 'bottom_left' // you can hide this module afterwards from the remote control itself }, { module: "clock", position: "top_left" }, { module: "calendar", header: "Upcoming", position: "top_left", config: { calendars: [ { symbol: "calendar-check-o ", url: "xxxx" } ] } }, { module: "compliments", position: "lower_third", config: { compliments: { anytime: [ "Hi there!", "I love you!", "You look great!", "You can do anything!", "Don't forget your keys!" ], morning: [ "Good morning beautiful!", "Good morning handsome!", "You is an icon", "Enjoy your day!" ], afternoon: [ "Looking good!", "You look nice!", "Have a good one!" ], evening: [ "Wow, you look great!", "Good evening!" ], rain: [ "Stay dry!", "Grab a jacket!" ], showers: [ "Stay dry!", "Grab a coat!" ], day_sunny: [ "Suns out, guns out!", "It's sunny! Go to a park!", "It's a beautiful day!" ] } } }, { module: "currentweather", position: "top_right", config: { location: "Seattle", locationID: "5809844", //ID from http://www.openweathermap.org/help/city_list.txt appid: "xxxx", roundTemp: "true" } }, { module: "weatherforecast", position: "top_right", header: "Weather Forecast", config: { location: "Seattle", locationID: "5809844", //ID from http://www.openweathermap.org/help/city_list.txt appid: "xxxx", roundTemp: "true" } }, { module: "newsfeed", position: "bottom_bar", config: { feeds: [ { title: "New York Times", url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml" }, { title: "Reuters", url: "http://feeds.reuters.com/reuters/topNews" }, { title: "Google News", url: "https://news.google.com/news/rss/?ned=us&gl=US&hl=en" } ], showSourceTitle: true, showPublishDate: true } }, ] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") {module.exports = config;}
-
@yawns I also missed them just after the } bracket.
-