• 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.

Can't edit compliments.js

Scheduled Pinned Locked Moved Troubleshooting
12 Posts 3 Posters 2.5k Views 3 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.
  • M Offline
    mayfield
    last edited by Apr 29, 2021, 8:21 AM

    Hello everyone

    I’ve been using magic mirror for a few days now and have had no trouble editing config.js. I’ve been able to change the calendar from US to Australia, the news feed and the weather to my location here in Fawkner.

    However each time I change the compliments.js and use ctrl o to save and then ctrl x to exit and then reboot the rpi no changes have been saved.

    I have tried sudo nano compliments.js and still no luck. Do I need to stop the magicmirror service in order to edit the compliments.js?

    What I want to do is add a few compliments and remove a couple.

    S 1 Reply Last reply Apr 29, 2021, 11:17 AM Reply Quote 0
    • S Offline
      sdetweil @mayfield
      last edited by sdetweil Apr 29, 2021, 11:18 AM Apr 29, 2021, 11:17 AM

      @mayfield no. but.

      don’t edit the source file. copy module setting to config.js… in this case the compliments object

      in general, never edit the source files. the system is designed to take what is in config.js first.

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      M 1 Reply Last reply Apr 29, 2021, 10:57 PM Reply Quote 0
      • M Offline
        mayfield @sdetweil
        last edited by Apr 29, 2021, 10:57 PM

        @sdetweil said in Can't edit compliments.js:

        @mayfield no. but.

        don’t edit the source file. copy module setting to config.js… in this case the compliments object

        in general, never edit the source files. the system is designed to take what is in config.js first.

        Ok thanks for the tip I will do that 👍

        1 Reply Last reply Reply Quote 0
        • M Offline
          mayfield
          last edited by Apr 30, 2021, 12:20 PM

          I’ve been reading through the documentation from here https://docs.magicmirror.builders/modules/compliments.html#configuration-options

          Each time I add this to the config it stops working I’m obviously missing something.

          { 
                          module: "compliments",
                          position: "lower_third"
                          config: { 
                          compliments: { 
                          anytime: [
                                  "Hey Wren!"
                          ],
                          morning: [
                                  "blah blah blah",
                                  "blah blah blah",
                                  "blah blah blah"
                          ],
                          afternoon: [
                                  "blah blah blah",
                                  "Yblah blah blah",
                                  "blah blah blah"
                          ],
                          evening: [
                                  "blah blah blah",
                                  "blah blah blah",
                                  "blah blah blah"
                          ],
                          "....-01-01": [
                                  "Happy new year!"
                          ]
                  }
          }
                          },
          
          T 1 Reply Last reply Apr 30, 2021, 12:27 PM Reply Quote 0
          • T Offline
            thgmirror @mayfield
            last edited by thgmirror Apr 30, 2021, 12:28 PM Apr 30, 2021, 12:27 PM

            Hi @mayfield,

            Most of the times, commas are missing (here at least after the line with the position). Use the builtin function to check if it is valid…I use a website where you can enter the whole content of your config.js:
            https://esprima.org/demo/validate.html

            Greetings
            Thomas

            S M 2 Replies Last reply Apr 30, 2021, 12:33 PM Reply Quote 0
            • S Offline
              sdetweil @thgmirror
              last edited by Apr 30, 2021, 12:33 PM

              @thgmirror the built-in checker is

              from the MagicMirror folder do

              npm run config:check
              

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              T M 2 Replies Last reply Apr 30, 2021, 12:39 PM Reply Quote 0
              • T Offline
                thgmirror @sdetweil
                last edited by Apr 30, 2021, 12:39 PM

                @sdetweil I know:-)

                S 1 Reply Last reply Apr 30, 2021, 12:41 PM Reply Quote 0
                • S Offline
                  sdetweil @thgmirror
                  last edited by Apr 30, 2021, 12:41 PM

                  @thgmirror typically ‘unexpected token’ means the line before was missing a trailing comma

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    mayfield @sdetweil
                    last edited by Apr 30, 2021, 12:41 PM

                    @sdetweil said in Can't edit compliments.js:

                    @thgmirror the built-in checker is

                    from the MagicMirror folder do

                    npm run config:check
                    

                    Yes this was going to be another question I wanted to ask as that doesn’t work on mine and I’m not sure why yet

                    I followed this site to flash a SD card https://github.com/guysoft/MagicMirrorOS

                    and when I run that I get this I guess I need to install that
                    alt text

                    S 1 Reply Last reply Apr 30, 2021, 12:45 PM Reply Quote 0
                    • S Offline
                      sdetweil @mayfield
                      last edited by sdetweil Apr 30, 2021, 12:47 PM Apr 30, 2021, 12:45 PM

                      @mayfield

                      ah mmos…
                      then u have to run the command inside the docker container where mm is installed

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      M 1 Reply Last reply Apr 30, 2021, 1:12 PM Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        1/12
                        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