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.

    Compliments module has stopped working

    Scheduled Pinned Locked Moved Solved Troubleshooting
    16 Posts 2 Posters 893 Views 2 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.
    • G Offline
      geekhouri @sdetweil
      last edited by

      @sdetweil thanks for your reply. Just to be clear you mean i should not edit the compliments.js file and any configs should be in the config.js file (Sorry probably a newbie question but im still learning)

      The mm.sh code is listed below:

      cd ./MagicMirror
      DISPLAY=:0 npm start
      
      

      I hope this is what you are after.

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @geekhouri
        last edited by sdetweil

        @geekhouri the mm.sh should be
        cd ~/MagicMirror

        ~ means logged on users home folder

        config.js, yes

        {
             module:"compliments",
             position:"....."
              config:{
                   compliments:   your compliments config {.. }
              }
        }
        

        the system design is
        whatever is in config.js, overrides/replaces what is defined in the module defaults section

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        G 1 Reply Last reply Reply Quote 0
        • G Offline
          geekhouri @sdetweil
          last edited by

          @sdetweil thanks for your feedback, i have updated my config.js file but now i run into the config file error and MM does not load. Code is below as is the error after running config: check

                          {
                                  module: "compliments",
                                  position: "top_bar"
                                  config: {
                                   compliments: {
                                           anytime: ["Be Smart, Be Kind, Be Like Jesus!"],
                                          morning: ["Good morning!", "Enjoy your day!", "How was school"],
                                          afternoon: ["How was School?", "Finish Your homework?"],
                                          evening: ["Sweet Dreams", "You look nice!", "Ready for School"],
                                          "....-01-12": ["Happy new year!"]
                                          "....02-12": ["Happy Birthday E!"]
                                          "....03-12": ["Happy Birthday Z!"]
                                          "....05-12": ["Happy Birthday G!"]
                                          }
                          },
          

          npm run config:check

          [24.01.2024 01:07.25.065] [INFO]  Checking file...  /home/gkhouri/MagicMirror/config/config.js
          [24.01.2024 01:07.25.165] [ERROR] Your configuration file contains syntax errors :(
          [24.01.2024 01:07.25.167] [ERROR] Line 68 column 4: Parsing error: Unexpected token config
          

          Line 68 is config: { …

          Thanks again

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @geekhouri
            last edited by sdetweil

            @geekhouri said in Compliments module has stopped working:

            Line 68 column 4: Parsing error: Unexpected token config

            yes, 99% of the time that means the line before was missing a trailing comma (which means more lines coming for this item)

            your last 4 lines of the compliments list do not have the trailing comma
            and the position line

            just because I didn’t include it my text above doesn’t mean it’s not required…

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            G 1 Reply Last reply Reply Quote 0
            • G Offline
              geekhouri @sdetweil
              last edited by

              @sdetweil made those changes and MM is working again however i the compliments are still not visible? Any thoughts?

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @geekhouri
                last edited by sdetweil

                @geekhouri also missing a close } before the last one

                                {
                                        module: "compliments",
                                        position: "top_bar",
                                        config: {
                                         compliments: {
                                                 anytime: ["Be Smart, Be Kind, Be Like Jesus!"],
                                                morning: ["Good morning!", "Enjoy your day!", "How was school"],
                                                afternoon: ["How was School?", "Finish Your homework?"],
                                                evening: ["Sweet Dreams", "You look nice!", "Ready for School"],
                                                "....-01-12": ["Happy new year!"],
                                                "....02-12": ["Happy Birthday E!"],
                                                "....03-12": ["Happy Birthday Z!"],
                                                "....05-12": ["Happy Birthday G!"],
                                                }  // end of compliments
                                      }  // end of config
                          } // end of module
                

                you should see the error where you start mm…

                if using pm2, then

                pm2 logs --lines=50
                

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                G 1 Reply Last reply Reply Quote 0
                • G Offline
                  geekhouri @sdetweil
                  last edited by

                  @sdetweil still nothing, here is my code in full and the pm2 logs:

                                  {
                                          module: "compliments",
                                          position: "top_bar",
                                          config: {
                                           compliments: {
                                                   anytime: ["Be Smart, Be Kind, Be Like Jesus!"],
                                                  morning: ["Good morning!", "Enjoy your day!", "How was school"],
                                                  afternoon: ["How was School?", "Finish Your homework?"],
                                                  evening: ["Sweet Dreams", "You look nice!", "Ready for School"],
                                                  "....-01-12": ["Happy new year!"],
                                                  "....02-12": ["Happy Birthday E!"],
                                                  "....03-12": ["Happy Birthday Z!"],
                                                  "....05-12": ["Happy Birthday G!"],
                                                          } //end of compliments
                                                  } //end of config
                                  }, //end of module
                  

                  Pm2 logs as follows:

                  0|mm       |     at Object..js (node:internal/modules/cjs/loader:1326:10)
                  0|mm       |     at Module.load (node:internal/modules/cjs/loader:1126:32)
                  0|mm       |     at node:internal/modules/cjs/loader:967:12
                  0|mm       | Warning: vkCreateInstance: Found no drivers!
                  0|mm       | Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
                  0|mm       |     at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/v                                                                                                                                                                                                                                             ulkan/VulkanError.cpp:88)
                  0|mm       |     at CreateVkInstance (../../third_party/dawn/src/dawn/native/vul                                                                                                                                                                                                                                             kan/BackendVk.cpp:458)
                  0|mm       |     at Initialize (../../third_party/dawn/src/dawn/native/vulkan/Ba                                                                                                                                                                                                                                             ckendVk.cpp:344)
                  0|mm       |     at Create (../../third_party/dawn/src/dawn/native/vulkan/Backen                                                                                                                                                                                                                                             dVk.cpp:266)
                  0|mm       |     at operator() (../../third_party/dawn/src/dawn/native/vulkan/Ba                                                                                                                                                                                                                                             ckendVk.cpp:521)
                  0|mm       |
                  0|mm       | /home/gkhouri/MagicMirror/node_modules/electron/dist/electron exite                                                                                                                                                                                                                                             d with signal SIGINT
                  0|mm       | [24.01.2024 01:29.00.569] [ERROR] WARNING! Could not validate confi                                                                                                                                                                                                                                             g file. Starting with default configuration. Please correct syntax errors at or                                                                                                                                                                                                                                              above this line: /home/gkhouri/MagicMirror/config/config.js:68
                  0|mm       |                    config: {
                  0|mm       |                    ^^^^^^
                  0|mm       |
                  0|mm       | SyntaxError: Unexpected identifier 'config'
                  0|mm       |     at internalCompileFunction (node:internal/vm:73:18)
                  0|mm       |     at wrapSafe (node:internal/modules/cjs/loader:1185:20)
                  0|mm       |     at Module._compile (node:internal/modules/cjs/loader:1227:27)
                  0|mm       |     at Object..js (node:internal/modules/cjs/loader:1326:10)
                  0|mm       |     at Module.load (node:internal/modules/cjs/loader:1126:32)
                  0|mm       |     at node:internal/modules/cjs/loader:967:12
                  0|mm       |     at Function._load (node:electron/js2c/asar_bundle:2:13327)
                  0|mm       |     at Module.require (node:internal/modules/cjs/loader:1150:19)
                  0|mm       |     at require (node:internal/modules/cjs/helpers:121:18)
                  0|mm       |     at loadConfig (/home/gkhouri/MagicMirror/js/app.js:118:14)
                  0|mm       |     at App.start (/home/gkhouri/MagicMirror/js/app.js:248:18)
                  0|mm       |     at Object.<anonymous> (/home/gkhouri/MagicMirror/js/electron.js                                                                                                                                                                                                                                             :192:7)
                  0|mm       |     at Module._compile (node:internal/modules/cjs/loader:1271:14)
                  0|mm       |     at Object..js (node:internal/modules/cjs/loader:1326:10)
                  0|mm       |     at Module.load (node:internal/modules/cjs/loader:1126:32)
                  0|mm       |     at node:internal/modules/cjs/loader:967:12
                  0|mm       | Warning: vkCreateInstance: Found no drivers!
                  0|mm       | Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
                  0|mm       |     at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/v                                                                                                                                                                                                                                             ulkan/VulkanError.cpp:88)
                  0|mm       |     at CreateVkInstance (../../third_party/dawn/src/dawn/native/vul                                                                                                                                                                                                                                             kan/BackendVk.cpp:458)
                  0|mm       |     at Initialize (../../third_party/dawn/src/dawn/native/vulkan/Ba                                                                                                                                                                                                                                             ckendVk.cpp:344)
                  0|mm       |     at Create (../../third_party/dawn/src/dawn/native/vulkan/Backen                                                                                                                                                                                                                                             dVk.cpp:266)
                  0|mm       |     at operator() (../../third_party/dawn/src/dawn/native/vulkan/Ba                                                                                                                                                                                                                                             ckendVk.cpp:521)
                  0|mm       |
                  0|mm       | /home/gkhouri/MagicMirror/node_modules/electron/dist/electron exite                                                                                                                                                                                                                                             d with signal SIGINT
                  0|mm       | Warning: vkCreateInstance: Found no drivers!
                  0|mm       | Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
                  0|mm       |     at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/v                                                                                                                                                                                                                                             ulkan/VulkanError.cpp:88)
                  0|mm       |     at CreateVkInstance (../../third_party/dawn/src/dawn/native/vul                                                                                                                                                                                                                                             kan/BackendVk.cpp:458)
                  0|mm       |     at Initialize (../../third_party/dawn/src/dawn/native/vulkan/Ba                                                                                                                                                                                                                                             ckendVk.cpp:344)
                  0|mm       |     at Create (../../third_party/dawn/src/dawn/native/vulkan/Backen                                                                                                                                                                                                                                             dVk.cpp:266)
                  0|mm       |     at operator() (../../third_party/dawn/src/dawn/native/vulkan/Ba                                                                                                                                                                                                                                             ckendVk.cpp:521)
                  0|mm       |
                  
                  
                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @geekhouri
                    last edited by

                    @geekhouri said in Compliments module has stopped working:

                    0|mm | [24.01.2024 01:29.00.569] [ERROR] WARNING! Could not validate confi g file. Starting with default configuration. Please correct syntax errors at or above this line: /home/gkhouri/MagicMirror/config/config.js:68
                    0|mm | config: {
                    0|mm | ^^^^^^
                    0|mm |
                    0|mm | SyntaxError: Unexpected identifier ‘config’

                    I can only assume you haven’t saved the updated config… (I do that sometimes…oops)

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    G 1 Reply Last reply Reply Quote 0
                    • G Offline
                      geekhouri @sdetweil
                      last edited by

                      @sdetweil thanks again. Saved the file, flushed the logs rebooted and new log is below no new errrors and i think you previously stated the errors below cant be hidden. . Still no Compliments working (i’m at a loss now)

                      0|mm       | Warning: vkCreateInstance: Found no drivers!
                      0|mm       | Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
                      0|mm       |     at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/v                                                                                                                                                                                                                                             ulkan/VulkanError.cpp:88)
                      0|mm       |     at CreateVkInstance (../../third_party/dawn/src/dawn/native/vul                                                                                                                                                                                                                                             kan/BackendVk.cpp:458)
                      0|mm       |     at Initialize (../../third_party/dawn/src/dawn/native/vulkan/Ba                                                                                                                                                                                                                                             ckendVk.cpp:344)
                      0|mm       |     at Create (../../third_party/dawn/src/dawn/native/vulkan/Backen                                                                                                                                                                                                                                             dVk.cpp:266)
                      0|mm       |     at operator() (../../third_party/dawn/src/dawn/native/vulkan/Ba                                                                                                                                                                                                                                             ckendVk.cpp:521)
                      0|mm       |
                      
                      
                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil @geekhouri
                        last edited by

                        @geekhouri ok, lets stop using pm2…

                        pm2 stop all

                        then
                        cd ~/MagicMirror
                        npm start

                        wait

                        if you are doing this on the MM screen
                        ctrl-q to stop mm (with pm2, it would restart it immediately… thats is job)

                        so, see anything in the output??

                        I used your config and it worked (on v2.26) without any issues

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        G 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 2 / 2
                        • First post
                          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