Read the statement by Michael Teeuw here.
Changing compliments
-
@doubleT I save from the terminal with ctrl o. Have also tried ctrl x, y.
When I get to the folders through the GUI, I can change the file and save it. I have uncomment ed the calendar, and moved things around, but when I add the configure script for new compliments I get the error message need a config file. I checked it using a terminal command someone gave me here and every line that I added it did not like, even though my code was exactly like the example.
Weird. However, I am learning a lot troubleshooting this issue and I appreciate all the help.
-
I had a similar problem. It showed an error for my entire addition to the config.js. Run check:config again and pay close attention to the beginning of the output. The first error should say something about expecting a bracket of one kind and it was returned a bracket of a different kind. It will also tell you the line of the error. Now nano back into config scroll down to your addition and press ctrl + c. The bottom of your screen should give you your current line number. Find the error. Mine was a missing bracket. Fixing this error fixed the entire script. All other errors were the result of the first. Sorry if I wasn’t clear or missed something, im still a new to this too. Hope it helps.
-
@AliAS remember after locating and fixing the error to hit ctrl + o to save and ctrl + x to exit nano.
-
Another suggestion, and someone please correct me if I am wrong, you could delete the config.js file and save as or copy the config-sample.js as a new config.js file. That way you have a functioning config.js. But doing so, you would have to reconfigure all your modules. Does that sound right?
-
@AliAS said in Changing compliments:
Does that sound right?
Sure, but another idea would be to rename the non-functioning config (so you don’t lose what’s in it) and THEN make a new copy of the config.js.sample and rename it to config.js. :-)
-
@Mykle1 Okay. We finally figured it out. We made an external join file for new compliments and that worked. Thank you all SOuch for your help.
-
Well done! :-)
-
External join file? Lol, thats way outta my league.
-
Does anybody know how to use a line break within a compliment? I’ve tried about a dozen different ways to no avail.
-
@AliAS
Compliments are included viadocument.createTextNode(complimentText);which doesn’t allow HTML inside.But you can change the line within
getDom: function() {}that includes the compliment from
wrapper.appendChild(compliment);
to
wrapper.innerHTML = complimentText;and then just add a
<br />to the compliment. -
I see. I’ll give it a try. Thank you very much.
-
@doubleT That worked perfect. Thanks again!
-
Oh, great! Another noob needs help configuring the Compliments module. I’ve sussed through this for two days trying to get this up and running to earn ‘cool dad points.’ I’ve followed along and made changes to the config.js file as described. When I run ‘npm start’ I get the following: ```
code_text> magicmirror@2.12.0 start /home/pi/MagicMirror > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js [2020-08-19 20:06:47.257] [LOG] Starting MagicMirror: v2.12.0 [2020-08-19 20:06:47.264] [LOG] Loading config ... [2020-08-19 20:06:47.268] [ERROR] WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/config/config.js:68 config: { ^^^^^^ SyntaxError: Unexpected identifier at Module._compile (internal/modules/cjs/loader.js:722:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10) at Module.load (internal/modules/cjs/loader.js:645:32) at Function.Module._load (internal/modules/cjs/loader.js:560:12) at Module.require (internal/modules/cjs/loader.js:685:19) at require (internal/modules/cjs/helpers.js:16:16) at loadConfig (/home/pi/MagicMirror/js/app.js:67:12) at App.start (/home/pi/MagicMirror/js/app.js:202:3) at Object.<anonymous> (/home/pi/MagicMirror/js/electron.js:126:7) at Module._compile (internal/modules/cjs/loader.js:786:30) [2020-08-19 20:06:47.269] [LOG] Loading module helpers ... [2020-08-19 20:06:47.317] [LOG] Initializing new module helper ... [2020-08-19 20:06:47.318] [LOG] Module helper loaded: updatenotification [2020-08-19 20:06:47.321] [LOG] No helper found for module: helloworld. [2020-08-19 20:06:47.322] [LOG] All module helpers loaded. [2020-08-19 20:06:47.445] [LOG] Starting server on port 8080 ... [2020-08-19 20:06:47.458] [LOG] Server started ... [2020-08-19 20:06:47.459] [LOG] Connecting socket for: updatenotification [2020-08-19 20:06:47.460] [LOG] Sockets connected & modules started ... [2020-08-19 20:06:47.556] [LOG] Launching application.What am I looking at? And how can I correct? Bear with a middle aged noob. You might have to explain this in crayon. Thanks for the help.
-
Post your config entry for compliments in a code block
-
@KC5RIL > Unexpected identifier
90% of the time this means a comma missing on the line above
-
@sdetweil Stand by, ya’ll. I’m proofing now. Just caught a misplaced comma.
-
@KC5RIL npm config:check can show these errors.
has a bug in 2.12, temp fix posted to the top of the troubleshooting section
-
@Mykle1 Here’s the code. Figured this seemed like a popular spot to wet my feet. If I could get through this, I could set the rest up.
{ module: "compliments", position: "lower_third" config: { compliments: { "....-01-01": [ "Happy New Year!" ], "....-01-07": [ "Happy Birthday, Matt!" ], "....-01-08": [ "Hail to the King, Baby!", "I'm all shook up!", "You ain't nuthin' but a hound dog!" ], "....-01-25": [ "yaD etisoppO yppaH" ], "2021-02-02": [ "It's Groundhog Day \nAgain!" ], "....-02-14": [ "Happy Valentine's Day!" ], "2021-02-16": [ "Laissez les bon temps rouler!" ], "....-03-14": [ "Time for Pi!" ], "2021-03-17": [ "Erin Go Bragh!", "Kiss Me! \nI'm Irish" ], "....-04-01": [ "Your shoes are untied.", "Made you look.", "April Fools!" ], "2021-04-04": [ "Happy Easter!", "Rejoice!", "He is Risen!" ], "....-05-04": [ "May the Fourth be with you!" ], "....-05-06": [ "Revenge of the Sixth!" ], "....-05-09": [ "Happy Mother's Day!" ], "....-05-25": [ "Don't forget your towel.", "42!" ], "2021-05-31": [ "Happy Memorial Day!" ], "2021-06-20": [ "Happy Father's Day!" ], "....-07-04": [ "Celebrate your Independence!", "Freedom!", "Happy Fourth of July!" ], "....-07-09": [ "Happy Birthday, Noodle!" ], "....-08-14": [ "Happy Anniversary!" ], "2021-09-06": [ "Happy Labor Day!" ], "....-09-11": [ "Never Forget.", "Some gave all", "343/61", "Let's Roll!" ], "...-10-..": [ "Boo!" ], "....-11-16": [ "Happy Birthday, Susanne!" ], "2021-11-25": [ "Gobble! Gobble!", "Happy Thanksgiving!" ], "....-12-07": [ "A day that will live in infamy!" ], "....-12-23": [ "Time to air our grievances!", "Festivus for the rest of us!" ], "....-12-25": [ "Merry Christmas, Charlie Brown!", "Rejoice!", "Christ the Savior is born!" ], anytime: { "Hey!", "Hello.", "Whaddup Dog?", "Dude!", "Hej!", "You stay classy!" ], morning: [ "Good Morning!", "Smile \nIt's a beautiful day!", "Rise and Shine!", "Wakey Wakey! \nEggs & Baky!", "Coffee is ready!" ], afternoon: [ "Is it beer-thirty, yet?", "What a wonderful day!" ], evening: [ "Good Evening." ] } },While ya’ll are looking at that, I’ll check the troubleshooting section. Thanks
-
position: "lower_third" config: {why did I say?
comma missing on the line before the errorposition: "lower_third", // < ----- config: { -
Okay! It’s coming together for me. I’m catching a couple more syntax errors. I’ll keep proofing to see if I catch more.
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