[Vuejs]-Error in callback for watcher “get_settings”: “TypeError: Cannot read property ‘general’ of undefined”

0👍

It seems to me that your watcher is looking for a property ‘general’ that is a child of gallery_settings.

get_settings.gallery_settings.general

In the meantime in data you have a property general that is a child of ‘settings_flags’. Those two don’t line up. So make sure that either your watcher is looking for something that exists when the component starts up, or tell your watcher to only start watching ‘ get_settings.gallery_settings.general’ when ‘get_settings.gallery_settings’ actually exists.

if (get_settings.gallery_settings) { do something } #pseudocode

I’m not sure that’s your problem, but it might be.

Leave a comment