MagicMirror² v2.12.0 is available! For more information about this release, check out this topic.

code issue



  • i have no clue what is wrong with my code, I am very new and had to restart my pi because i was testing stuff. I put all my changes back in at once(which I now realized was dumb lol) and now it says config error. i tried to use this
    node tests/configs/check_configs.js but this didnt seem to work. here is the code, thanks in advance for the help!

            language: "en",
            timeFormat: 12,
            units: "imperial",
    
            modules: [
                    {
                            module: "alert",
                    },
                    {
                            module: "updatenotification",
                            position: "top_bar"
                    },
                    {
                            module: "clock",
                            position: "top_left"
                            config: {
                                    displaySeconds: false,
                    }
                    },
                    {
                            module: "",
                            header: "US Holidays",
                            position: "top_left",
                            config: {
                                    calendars: [
                                            {
                                                    symbol: "calendar-check",
                                                    url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics"
                                            }
                                    ]
                            }
                    },
                    {
                            module: "",
                            position: "lower_third"
                    },
     {
                            module: "currentweather",
                            position: "top_right",
                            config: {
                                    onlyTemp: true,
                                    roundTemp: true,
                                    location: "Shawnee",
                                    locationID: "4279247",  //ID from http://bulk.openweathermap.org/sample/; unzip the gz file and find your city
                                    appid: "6272b5d982857a7f9dc98abe37f263f4"
                            }
                    },
                    {
                            module: "weatherforecast",
                            position: "top_right",
                            header: "Weather Forecast",
                            config: {
                                    roundTemp: true,
                                    location: "Shawnee",
                                    locationID: "4279247",  //ID from https://openweathermap.org/city
                                    appid: "6272b5d982857a7f9dc98abe37f263f4"
                            }
                    },
                    {
                            module: "",
                            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;}
    


  • @cade72

    not sure if this helps but here is what comes up when i put in node tests/configs/check_configs.js

    ~/MagicMirror $ node tests/configs/check_configs.js
    internal/modules/cjs/loader.js:550
    throw err;
    ^

    Error: Cannot find module ‘/home/pi/MagicMirror/tests/configs/check_configs.js’
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)



  • @cade72 said in code issue:

    > node tests/configs/check_configs.js
    

    one too many ‘s’…

    node tests/configs/check_config.js
    

    my error…


  • Module Developer

    @cade72 after position of clock, comma is missed.



  • @sdetweil ohhh all good, I was super confused why it wasnt working. Thanks!



  • @sean commas always seem to win vs me lol. Thanks!


Log in to reply