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



  • 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>
    


  • I think you forget to import QSearch and QAutocomplete



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



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



  • 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 :-)



  • I’m experiencing this error with autocomplete.



  • 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.



  • This post is deleted!


  • This post is deleted!

Log in to reply
 

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.