I am getting this error 'Cannot read property 'error' of undefined' after refreshing page in browser. It works fine if I navigate to page with nuxt-link. It also works fine if i use $toasted in mounted function instead of created.
mycomponent.vue
created() {
// This does not work
this.$toast.error('Error')
},
mounted() {
// This works
this.$toast.error('Error')
}
nuxt.config.js
modules: [
'@nuxtjs/toast',
],
toast: {
position: 'bottom-right'
},
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2471">#c2471</a>)</em></sub></div>