MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    UNSOLVED Quick Syntax Error

    Troubleshooting
    5
    20
    2046
    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
      smartsoldier last edited by smartsoldier

      Can someone take a look at the new config setup for MMM-DropboxWallpaper and tell me where the syntax is wrong:

      {
        module: 'MMM-DropboxWallpaper',
        position: 'fullscreen_below', // fullscreen_below is the best position.
        classes: "default everyone", // when you use MMM-ProfileSwitcher.
        config: {
          refreshInterval: 1000*60,
          search: [".jpg", ".png", ".gif"], // Or you can find target files like "PARTIAL FILENAME". (wildcard or regexp not supported)
          directory: "/Pics", // root of directories of Dropbox to be scanned.
          sort: "random", //"time09", "time90", "nameAZ", "nameZA", "random"
          tokenLocationIQ : "secret", // See http://locationiq.org/#register
          dropboxAccessToken: "secret",
          width: "100%", // 'px' or '%' or valid value for CSS dimensions units.
          height: "100%",
          mode: "contain", // 'cover', 'contain', 'hybrid' or any other values for CSS `background-size`
          dateTimeFormat: "HH:mm MMM Do, YYYY", // See. moment.js .format()
        }
      },
      

      All I did was change my directory and API codes, but its giving the syntax error during startup. Seeing anything?

      justjim1220 2 Replies Last reply Reply Quote 0
      • justjim1220
        justjim1220 Module Developer @smartsoldier last edited by

        @smartsoldier said in Quick Syntax Error:

        dateTimeFormat: “HH:mm MMM Do, YYYY”, // See. moment.js .format()

        take out the comma after YYYY"

        "Life's Too Short To Dance With Ugly People"
        Jim Hallock - 1995

        1 Reply Last reply Reply Quote 0
        • ?
          A Former User last edited by A Former User

          @smartsoldier
          I’ve copied your configuration and tried. but there was no syntax error.

          {
          		  module: 'MMM-DropboxWallpaper',
          		  position: 'fullscreen_below', // fullscreen_below is the best position.
          		  classes: "default everyone", // when you use MMM-ProfileSwitcher.
          		  config: {
          		    refreshInterval: 1000*60,
          		    search: [".jpg", ".png", ".gif"], // Or you can find target files like "PARTIAL FILENAME". (wildcard or regexp not supported)
          		    directory: "/MyMirror", // root of directories of Dropbox to be scanned.
          		    sort: "random", //"time09", "time90", "nameAZ", "nameZA", "random"
          		    tokenLocationIQ : "", // See http://locationiq.org/#register
          		    dropboxAccessToken: "",
          		    width: "100%", // 'px' or '%' or valid value for CSS dimensions units.
          		    height: "100%",
          		    mode: "contain", // 'cover', 'contain', 'hybrid' or any other values for CSS `background-size`
          		    dateTimeFormat: "HH:mm MMM Do, YYYY", // See. moment.js .format()
          		  }
          		},
          
          1 Reply Last reply Reply Quote 0
          • evroom
            evroom last edited by

            I would try changing this:

            tokenLocationIQ : "secret",
            

            to this:

            tokenLocationIQ: "secret",
            

            MagicMirror version: 2.18.0
            Raspberry Pi 3 Model B Plus Rev 1.3
            Raspbian GNU/Linux 10 (buster)

            1 Reply Last reply Reply Quote 0
            • S
              smartsoldier last edited by

              I tried taking out the comma after YYYY, and moving the : closer to tokenLocationIQ. Neither worked. I’m not really sure how Sean managed to run without syntax errors when I am using the exact same config…

              ? 2 Replies Last reply Reply Quote 0
              • ?
                A Former User @smartsoldier last edited by

                @smartsoldier I’ve copied from your post and nothing changed except some private values(tokens)

                1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @smartsoldier last edited by

                  @smartsoldier
                  Most of the syntax errors could be raised by missing or exceeding bracket, comma.
                  I suggest you remove configuration of modules one-by-one and try.
                  Or you should upload a complete config.js here.

                  1 Reply Last reply Reply Quote 0
                  • evroom
                    evroom last edited by

                    I also do not get an error when copy/pasting your config lines.

                    $ npm run config:check
                    

                    does not give an error.
                    You should try it yourself; a very useful command.
                    Perhaps the error does not apply to the MMM-DropboxWallpaper config ?

                    MagicMirror version: 2.18.0
                    Raspberry Pi 3 Model B Plus Rev 1.3
                    Raspbian GNU/Linux 10 (buster)

                    1 Reply Last reply Reply Quote 0
                    • S
                      smartsoldier last edited by

                      Ok well I used npm run config:check and it found no errors, but I still get the syntax error message is red when I start up the MM. What is happening!??!

                      ? 1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User @smartsoldier last edited by

                        @smartsoldier We don’t know. Remove all the modules in config.js and add one-by-one. Let’s see what happens.

                        S 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy