BrianHepler / MMM-WeatherBackground

MagicMirror Module - for Weather image background from Unsplash. This is a plugin of other weather modules.
MIT License
16 stars 9 forks source link

Uncaught TypeError: Cannot read properties of undefined (reading 'split') #16

Closed EphraimB closed 1 year ago

BrianHepler commented 2 years ago

Can you give me the relevant part of your config.js file, please? Just post it here. Remember to edit out your API key.

salvega90 commented 1 year ago

I too am getting this error when using the MMM-NOAA3 source. Not sure how related this is, but no images are showing up on my magicmirror.

{
        module: "MMM-WeatherBackground",
        config: {
            verbose: true,
            source: "MMM-NOAA3", 
            size: null,
            hemisphere: "n", 
            monthMap: ['NewYear', 'winter', 'spring', 'spring flower', 'joy', 'summer rain', 'summer beach', 'summer vacation', 'autumn', 'autumn leaves', 'winter', 'christmas'], 
             targetDOM: ".fullscreen.below",
            notification: null,
            payloadConverter: null,
            defaultCollection: null,
            externalCollections: "collections.json",
            collections: {},
        }
    }

Error:

MMM-WeatherBackground.js:44 Uncaught TypeError: Cannot read properties of undefined (reading 'split')
    at Class.payloadConverter (MMM-WeatherBackground.js:44:39)
    at Class.notificationReceived (MMM-WeatherBackground.js:137:30)
    at sendNotification (main.js:99:12)
    at Object.sendNotification (main.js:537:4)
    at Class.sendNotification (module.js:374:6)
    at Class.processWeather (MMM-NOAA3.js:211:11)
    at Class.socketNotificationReceived (MMM-NOAA3.js:172:18)
    at module.js:250:9
    at Socket.<anonymous> (socketclient.js:39:4)
    at ./node_modules/component-emitter/index.js.Emitter.emit (index.js:145:

MMM-NOAA3 Config:

{
        // Docs: https://github.com/cowboysdude/MMM-NOAA3
        module: 'MMM-NOAA3',
        position: 'top_left',
        config: {
            provider: "weatherbit",
            apiKey: "XXX",
            airKey: "XXXX",
            css: "NOAA3",
            userlat: "XXXX",
            userlon: "XXXX"
        }
    }
salvega90 commented 1 year ago

I created PR https://github.com/BrianHepler/MMM-WeatherBackground/pull/19, let me know what you think.