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

Config File Undeclared 'module'

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 2 Posters 1.4k 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.
  • L Offline
    laruatta
    last edited by Apr 7, 2017, 6:51 PM

    I’m not new to programming, but I am certainly new to scripting languages. I’m trying to get the PI to recognize even the sample config file. I’ve linted it and fixed a few syntactical errors, but the linter is stuck on the last line. I’ve included a screenshot of the error messages. Simply because I don’t know JavaScript can anyone explain these errors and how “module” is undefined?

    0_1491591046185_Lint Output 4_7_2017.PNG

    /* Magic Mirror Config Sample
     *
     * By Michael Teeuw http://michaelteeuw.nl
     * MIT Licensed.
     */
    
    var config = {
        port: 8080,
        ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses.
    
        language: "en",
        timeFormat: 24,
        units: "metric",
    
        module: [
            {
                module: "alert"
            },
            {
                module: "updatenotification",
                position: "top_bar"
            },
            {
                module: "clock",
                position: "top_left"
            },
            {
                module: "calendar",
                header: "US Holidays",
                position: "top_left",
                config: {
                    calendars: [
                        {
                            symbol: "calendar-check-o ",
                            url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics"
                        }
                    ]
                }
            },
            {
                module: "compliments",
                position: "lower_third"
            },
            {
                module: "currentweather",
                position: "top_right",
                config: {
                    location: "New York",
                    locationID: "",  //ID from http://www.openweathermap.org/help/city_list.txt
                    appid: "YOUR_OPENWEATHER_API_KEY"
                }
            },
            {
                module: "weatherforecast",
                position: "top_right",
                header: "Weather Forecast",
                config: {
                    location: "New York",
                    locationID: "5128581",  //ID from http://www.openweathermap.org/help/city_list.txt
                    appid: "YOUR_OPENWEATHER_API_KEY"
                }
            },
            {
                module: "newsfeed",
                position: "bottom_bar",
                config: {
                    feeds: [
                        {
                            title: "New York Times",
                            url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
                        }
                    ],
                    showSourceTitle: true,
                    showPublishDate: true
                }
            }
        ]
    
    };
    
    /*************** DO NOT EDIT THE LINE BELOW ***************/
    if (typeof module !== "undefined") {module.exports = config;}
    
    1 Reply Last reply Reply Quote 0
    • L Offline
      laruatta
      last edited by Apr 7, 2017, 6:54 PM

      Proper image.

      0_1491591194907_Lint Output 4_7_2017.PNG

      1 Reply Last reply Reply Quote 0
      • Y Offline
        yawns Moderator
        last edited by Apr 7, 2017, 9:34 PM

        The warning can be ignored. If you check the file as a standalone, module is undefined. If this file is loaded within the framework the content is parsed and processed and module is valid

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