No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [Solved] Unhandled promise rejection TypeError: "_this.$q.dialog is not a function"

    Framework
    5
    6
    4038
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ssuess
      ssuess last edited by ssuess

      I don’t know why I am getting this error (and no dialog showing), any suggestions?

      1. I have verified that I added the component 'Dialog" to the list in quasar.conf.js
      2. I am using this code to call it:
      this.$q.dialog({
                      title: 'Confirm',
                      message: 'There is a new version available. Your version will be updated.',
                      ok: 'Update'
                    }).then(() => {
                      window.location.reload(true)
                      this.$setItem('myapp_version', this.curVersion)
                    }).catch(() => {
                      alert('Houston...')
                    })
      

      Is there something wrong or missing? Why would I get that error? I am using latest Quasar ( CLI v0.17.15 and Framework v0.17.12)

      1 Reply Last reply Reply Quote 1
      • ssuess
        ssuess last edited by

        UGH nevermind…I had accidentally added ‘Dialog’ to COMPONENTS list instead of PLUGINS list!

        D 1 Reply Last reply Reply Quote 1
        • L
          Lou Rectoret last edited by

          Yeah I happened the same to me. They should specify at the very begining that there are 2 ways of using it: as plugin, and as a component.

          1 Reply Last reply Reply Quote 1
          • D
            DeElfos @ssuess last edited by

            @ssuess
            I know it’s an old topic but it helped me to solve a problem that I didn’t fix, thank you very much

            1 Reply Last reply Reply Quote 1
            • metalsadman
              metalsadman last edited by

              They are separate in the docs though, Dialog and QDialog respectively. Q prefixed means it’s a component.

              1 Reply Last reply Reply Quote 2
              • DarkLite1
                DarkLite1 last edited by

                I had the same problem and expected the quasar cli to add the plugin dependency automatically but it only does so for components. So as the docs clearly mention one should add the plugin manually:

                // quasar.conf.js
                
                return {
                  framework: {
                    plugins: [
                      'Dialog'
                    ]
                  }
                }
                
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post