How to fix ‘Error in getter for watcher “isDark”‘ in Vue

Total
37
Shares

Some time ago I developed a form with Vue, importing Vuetify as a library so to speak, despite some warnings the form worked perfectly, it stopped working showing the following error

"Error in getter for watcher" isDark ":" TypeError: this. $ vuetify.theme is undefined "

I do not know if it is due to a change of version of Vue, I already gave several turns to the problem and I find no solution

This is what I mean as I implemented vue and vuetify

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify/dist/vuetify.js"></script>

Solution

Also, if you are getting “TypeError: this. $ vuetify.theme is undefined” when trying to move from 1.5 to 2.0, it’s like to be a case of not following the upgrade guide correctly.

See the bootstrap bit of https://github.com/vuetifyjs/vuetify/releases#user-content-upgrade-guide. There are some subtle changes in the examples e.g. passing ‘vuetify’ to new Vue. Not following that bit of the upgrade guide can generate the above error.

Leave a Reply

Your email address will not be published. Required fields are marked *