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

Change Compliments

Scheduled Pinned Locked Moved Solved Troubleshooting
17 Posts 7 Posters 5.3k Views 7 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.
  • S Away
    sdetweil @CheapDad
    last edited by sdetweil Apr 24, 2021, 8:26 PM Apr 24, 2021, 8:25 PM

    @cheapdad u should have gotten an error in the window where u start MM…
    I do copying your stuff

    		},
    		^
    SyntaxError: Unexpected token '}'
        at wrapSafe (internal/modules/cjs/loader.js:1060:16)
        at Module._compile (internal/modules/cjs/loader.js:1108:27)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
        at Module.load (internal/modules/cjs/loader.js:992:32)
        at Module._load (internal/modules/cjs/loader.js:885:14)
        at Function.f._load (electron/js2c/asar_bundle.js:5:12738)
        at loadApplicationPackage (/home/sam/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js:110:16)
        at Object.<anonymous> (/home/sam/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js:222:9)
        at Module._compile (internal/modules/cjs/loader.js:1152:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
    

    and npm config:check says

    (base) sam@sams:~/MagicMirror$ npm run config:check
    
    > magicmirror@2.15.0 config:check /home/sam/MagicMirror
    > node js/check_config.js
    
    [24.04.2021 15:25.20.258] [INFO]  Checking file...  /home/sam/MagicMirror/config/config.js
    [24.04.2021 15:25.20.270] [ERROR] Your configuration file contains syntax errors :(
    [24.04.2021 15:25.20.270] [ERROR] Line 56 column 7: Parsing error: Unexpected token {
    

    shorter answer, u are missing a }

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    C 1 Reply Last reply Apr 24, 2021, 9:03 PM Reply Quote 0
    • C Offline
      CheapDad @sdetweil
      last edited by Apr 24, 2021, 9:03 PM

      @sdetweil That’s the strange thing, I’m not getting any errors when I run npm run config:check.

      Unfortunately, I had to rebuild my config.js since I installed a module, edited config.js and ended up with a blank screen that no commenting the config.js entries didn’t fix.

      Here’s the new (old) compliments entries:

      			module: "compliments",
      			position: "lower_third",
      			config:  {
      				compliments: {
      					anytime: ["Hey there Emma!"],
      					morning: ["Good morning, Emma!", "Enjoy your day!", "How was your sleep?"],
      					afternoon: ["Hello, Emma!", "You look beautiful!", "Looking good today!"],
      					evening: ["Wow, you look great!", "You look nice!", "Hi, Emma!"],
      					"....-01-01": ["Happy new year!"]
      		}
      	},
      

      And my npm run config:check:

      pi@emmasmagicmirror:~/MagicMirror $ npm run config:check
      
      > magicmirror@2.15.0 config:check /home/pi/MagicMirror
      > node js/check_config.js
      
      [24.04.2021 16:58.15.197] [INFO]  Checking file...  /home/pi/MagicMirror/config/config.js
      [24.04.2021 16:58.15.352] [INFO]  Your configuration file doesn't contain syntax errors :)
      pi@emmasmagicmirror:~/MagicMirror $ 
      
      S 1 Reply Last reply Apr 24, 2021, 9:06 PM Reply Quote 0
      • S Away
        sdetweil @CheapDad
        last edited by Apr 24, 2021, 9:06 PM

        @cheapdad

        the thing is

        { 
            module:"name",
            position:"...",
            config: { 
                compliments: {
                }   //< ---- this brace is missing
            }
        }
        
        get bitvise ssh client, then u can have a file manager view from windows
        and use notepad++ to edit  and see the  brace, paren and bracket matching

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • C Offline
          CheapDad
          last edited by Apr 24, 2021, 9:27 PM

          Forgive me for pursuing this, but I see an opportunity to really learn here. When I look at my code, I have closed all of my braces:

              },
          			module: "compliments",
          			position: "lower_third",
          			config:  {  \\ open
          				compliments: {  \\open
          					anytime: ["Hey there Emma!"],
          					morning: ["Good morning, Emma!", "Enjoy your day!", "How was your sleep?"],
          					afternoon: ["Hello, Emma!", "You look beautiful!", "Looking good today!"],
          					evening: ["Wow, you look great!", "You look nice!", "Hi, Emma!"],
          					"....-01-01": ["Happy new year!"]
          		}   \\close
          	}, \\close
          			module: "weather",
          

          If I add another closing brace, won’t I have an error because there is no opening brace?

          On the suggestion for bitvise ssh, I’m working directly off the pi itself. I would love to run the entire MM configuration in a vm until it is right and then simply copy that over to the pi, but that’s a bit beyond my knowledge level.

          S 1 Reply Last reply Apr 24, 2021, 9:33 PM Reply Quote 0
          • S Away
            sdetweil @CheapDad
            last edited by Apr 24, 2021, 9:33 PM

            @cheapdad u are missing the open brace for the module block in this last picture (see my layout above)

            if you use bitvise then u dont have to edit ON the pi keyboard…
            also gives u an ssh window to execute commands, again NOT on the pi keyboard

            u can run raspian x86 in a vm on pc…

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • C Offline
              CheapDad
              last edited by Apr 24, 2021, 9:34 PM

              I think I figured it out and see where I needed a third closing brace. The weird thing is that Compliments seems to be the only module that doesn’t start with an opening brace, where all the others appear to. If I add an opening brace to it, I get an error. If I leave it out, it runs.

              S 1 Reply Last reply Apr 24, 2021, 9:36 PM Reply Quote 0
              • S Away
                sdetweil @CheapDad
                last edited by Apr 24, 2021, 9:36 PM

                @cheapdad EVERY module MUST start with an opening brace…

                ignore any typos you find somewhere else…

                see my module diagram above

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                C 1 Reply Last reply Apr 24, 2021, 9:46 PM Reply Quote 0
                • C Offline
                  CheapDad @sdetweil
                  last edited by Apr 24, 2021, 9:46 PM

                  @sdetweil Got it.

                  S 1 Reply Last reply Apr 24, 2021, 10:55 PM Reply Quote 0
                  • S Away
                    sdetweil @CheapDad
                    last edited by Apr 24, 2021, 10:55 PM

                    @cheapdad I sent u a chat message

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

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