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

Parsing error: Unexpected token {

Scheduled Pinned Locked Moved Unsolved Troubleshooting
6 Posts 2 Posters 461 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.
  • D Offline
    Dawcio232v2
    last edited by Nov 30, 2024, 3:38 PM

    Error when loading magic mirror.

    dawcio232@raspberrypi:~/MagicMirror $ npm run start
    
    > magicmirror@2.29.0 start
    > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js
    
    [2024-11-30 16:32:47.262] [LOG]   Starting MagicMirror: v2.29.0 
    [2024-11-30 16:32:47.274] [LOG]   Loading config ... 
    [2024-11-30 16:32:47.275] [LOG]   config template file not exists, no envsubst 
    [2024-11-30 16:32:47.497] [INFO]  Checking config file /home/dawcio232/MagicMirror/config/config.js ... 
    [2024-11-30 16:32:47.513] [ERROR] Your configuration file contains syntax errors :(
    Line 81 column 3: Parsing error: Unexpected token { 
    
    

    Command line ^
    Config V

    /* Config Sample
     *
     * For more information on how you can configure this file
     * see https://docs.magicmirror.builders/configuration/introduction.html
     * and https://docs.magicmirror.builders/modules/configuration.html
     *
     * You can use environment variables using a `config.js.template` file instead of `config.js`
     * which will be converted to `config.js` while starting. For more information
     * see https://docs.magicmirror.builders/configuration/introduction.html#enviromnent-variables
     */
    let config = {
    	address: "localhost",	// Address to listen on, can be:
    							// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
    							// - another specific IPv4/6 to listen on a specific interface
    							// - "0.0.0.0", "::" to listen on any interface
    							// Default, when address config is left out or empty, is "localhost"
    	port: 8080,
    	basePath: "/",	// The URL path where MagicMirror² is hosted. If you are using a Reverse proxy
    									// you must set the sub path here. basePath must end with a /
    	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],	// Set [] to allow all IP addresses
    									// or add a specific IPv4 of 192.168.1.5 :
    									// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
    									// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
    									// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
    
    	useHttps: false,			// Support HTTPS or not, default "false" will use HTTP
    	httpsPrivateKey: "",	// HTTPS private key path, only require when useHttps is true
    	httpsCertificate: "",	// HTTPS Certificate path, only require when useHttps is true
    
    	language: "en",
    	locale: "en-US",
    	logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
    	timeFormat: 24,
    	units: "metric",
    
    	modules: [
    		{
    			module: "alert",
    		},
    		{
    			module: "updatenotification",
    			position: "top_bar"
    		},
    		{
    			module: "clock",
    			position: "top_left"
    		},
    		{
    			module: "calendar",
    			header: "US Holidays",
    			position: "top_left",
    			config: {
    				calendars: [
    					{
    						fetchInterval: 7 * 24 * 60 * 60 * 1000,
    						symbol: "calendar-check",
    						url: "https://www.officeholidays.com/ics-all/poland"
    					}
    				]
    			}
    		},
    		{
    			module: "compliments",
    			position: "lower_third"
    		},
    		{
    			module: "weather",
    			position: "top_right",
    			config: {
    				weatherProvider: "openmeteo",
    				type: "current",
    				lat: 40.776676,
    				lon: -73.971321
    			}
    		},
                    {
                           module: 'MMM-ProfileSwitcher',
                           config: {
                                    // See 'Configuration options' for more information.
                    },
    		{
    		 	module: "weather",
    			position: "top_right",
    			header: "Codzienna",
    			config: {
    				weatherProvider: "openmeteo",
    				type: "daily",
    				lat: 40.776676,
    				lon: -73.971321
    			}
                },
                     {
                          module: 'MMM-Advent',
                          position: 'bottom_center', // This can be any of the regions, best results in center regions
                          config: {
                                   // See 'Configuration options' for more information.
                    }
                    },
                    {
                           module: "helloworld",
                           position: "bottom_bar", // This can be any of the regions.
                           config: {
                                    // See 'Configuration options' for more information.
                                    text: "Witaj Dawid!",
                    },
    		{
                           module: "MMM-MagicMover",
                           config: {
                                    updateInterval: 10 * 60 * 1000,
                                    ignoredRegions: [],
                                    maxMove: 15,
                                    moveWholescreen: false,
                     }
    },
    		},
    
    	]
    };
    
    /*************** DO NOT EDIT THE LINE BELOW ***************/
    if (typeof module !== "undefined") { module.exports = config; }
    
    
    S 1 Reply Last reply Nov 30, 2024, 4:16 PM Reply Quote 0
    • S Away
      sdetweil @Dawcio232v2
      last edited by sdetweil Dec 1, 2024, 5:47 PM Nov 30, 2024, 4:16 PM

      @Dawcio232v2

                      {
                             module: 'MMM-ProfileSwitcher',
                             config: {
                                      // See 'Configuration options' for more information.
      ---missing close brace for config: {----
                      },
      

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      D 1 Reply Last reply Dec 1, 2024, 5:36 PM Reply Quote 1
      • D Offline
        Dawcio232v2 @sdetweil
        last edited by Dec 1, 2024, 5:36 PM

        @sdetweil it dosent work!
        Zrzut ekranu 2024-12-01 183551.png

        S 1 Reply Last reply Dec 1, 2024, 5:46 PM Reply Quote 0
        • S Away
          sdetweil @Dawcio232v2
          last edited by Dec 1, 2024, 5:46 PM

          @Dawcio232v2 can you run the config checker

          npm run config:check 
          

          find the line it complains about, go back 1 and see if it is correct
          sometimes it is missing a trailing comma

          here is was a ,issing close brace }

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • D Offline
            Dawcio232v2
            last edited by Dec 7, 2024, 9:02 AM

            Zrzut ekranu 2024-12-07 100221.png

            S 1 Reply Last reply Dec 7, 2024, 12:55 PM Reply Quote 0
            • S Away
              sdetweil @Dawcio232v2
              last edited by Dec 7, 2024, 12:55 PM

              @Dawcio232v2 paste the text. Pictures don’t help

              Show the config, find line 82 and look for a missing trailing comma on line 81

              Sam

              How to add modules

              learning how to use browser developers window for css changes

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