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.

    Unexpected token error

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    3 Posts 2 Posters 272 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.
    • Z Offline
      zalgo
      last edited by sdetweil

      Hi, whenever I do a config check through npm, I get an error saying “Line 127 column 2: Parsing error: Unexpected token ;”. When I go to check where this line is, it is at the end of the config, which has this

                      height: "720" ,
                      width: "1200" ,
                      quality: "100" ,
                      displayResult: "true" ,
                      device: "null" ,
                      shootMessage: "Smile!" ,
                      displayCountdown: "true" ,
                      displayResult: "true" ,
                      resultDuration: "500 * 5" ,
                              }
                      }
              ],
      };  
      

      Any help would be appreciated.

      S 2 Replies Last reply Reply Quote 0
      • S Offline
        sdetweil @zalgo
        last edited by

        @zalgo 99% of the time Unexpected token means the line before the reported line is missing a trailing comma.

        I don’t see that here. but you have other problems

        the javascript rules are

        the thing the left of : does not need quotes, unless it contains a non-alpha character
        the thing to the right does NOT need quotes IF it is a number, an formula w numbers, or true or false , OR its a structure start { or array start [,

        otherwise it does need quotes

        your “500 * 5” is a formula and js will calculate that

        Sam

        How to add modules

        learning how to use browser developers window for css changes

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

          @zalgo because the error is end of file, it means it is confused.

          look at the config.js.sample

          Sam

          How to add modules

          learning how to use browser developers window for css changes

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