Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using with nuxt: cannot destructure property 'message' of '$dialog' as it is undefined #144

Open
MarceloLuis1997 opened this issue Jan 14, 2022 · 0 comments

Comments

@MarceloLuis1997
Copy link

MarceloLuis1997 commented Jan 14, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant