vuetify-dialog
vuetify-dialog copied to clipboard
Problem using with nuxt: cannot destructure property 'message' of '$dialog' as it is undefined
Hi!
I'm having some problems using this plugin with Nuxt + Vuetify + @nuxtjs/composition-api. Sometimes it just not work, showing the error: cannot destructure property 'message' of '$dialog' as it is undefined
// composables/dialog.js
import { useContext } from '@nuxtjs/composition-api'
export function useDialog () {
const { $dialog } = useContext()
const { message, error, info, warning, notify } = $dialog
function showInfo (title, text) {
return info({ title, text })
}
function messageSuccess (text) {
return message.success(text)
}
// ... some other functions with message, error, info, warning
return {
$dialog,
showInfo,
messageSuccess,
// ...
}
}
It works randomly, sometimes it works and other times the error appears. It happens on development environment and in production.