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

    Error "[Vue warn]: Error in mounted hook: "TypeError: Cannot read property 'register' of undefined" using a VERY SIMPLE QAutocomplete example

    Framework
    5
    9
    2969
    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.
    • M
      MagoSchmidt last edited by

      This is a VERY SIMPLE exampe of QAutocomplete use. I think i’m missing something basic. Could anyone help?

      The code below is giving me the error: "Error in mounted hook: “TypeError: Cannot read property ‘register’ of undefined”

      (all imports are OK!)

      <template>
        <q-search v-model="terms" placeholder="Start typing a country name">
          <q-autocomplete @search="search" /> 
        </q-search>
      </template> 
      
      <script type="text/javascript">
      
        import { filter } from 'quasar'
      
        const countries = [
          {'country': 'Afghanistan'},
          {'country': 'Brazil'},
          {'country': 'Zimbabwe'}
        ]
      
        function parseCountries () {
          return countries.map(country => {
            return {
              label: country,
              value: country
            }
          })
        }
      
        export default {
      
          data () {
            return {
              terms: '',
              countries: parseCountries()
            }
          },
      
          methods: {
            search (terms, done) {
              setTimeout(() => {
                done(filter(terms, {field: 'value', list: parseCountries()}))
              }, 1000)
            }
          }
        }
      </script>
      
      1 Reply Last reply Reply Quote 0
      • cheebhodh
        cheebhodh last edited by

        I think you forget to import QSearch and QAutocomplete

        D 1 Reply Last reply Reply Quote 0
        • M
          MagoSchmidt last edited by

          No, I don’t. All imports are OK as mentioned previously

          1 Reply Last reply Reply Quote 0
          • D
            Dayang @cheebhodh last edited by

            @cheebhodh I met the same situation,I’m sure all the components are imported correctly

            1 Reply Last reply Reply Quote 0
            • M
              MagoSchmidt last edited by

              I upgraded to 0.15 and it’s ok now. (Perhaps it has nothing to do with the upgrade but something in the middle of the process fixed it 🙂

              1 Reply Last reply Reply Quote 0
              • R
                robson last edited by

                I’m experiencing this error with autocomplete.

                1 Reply Last reply Reply Quote 0
                • P
                  ptburkis last edited by

                  I seeing exactly the same issue as the op - gone through various attempts at debugging, definitely something to do with the q-autocomplete, if I remove it from the page everything is ok, as soon as I drop it back in I get the same error as the op. All of the exports are correct.

                  1 Reply Last reply Reply Quote 0
                  • P
                    ptburkis last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • P
                      ptburkis last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post