ikloster03 / vue-dadata

Vue component for hinting addresses using dadata.ru
https://vue-dadata.ikloster.tech
MIT License
28 stars 31 forks source link

Error in v-on handler (Promise/async): "TypeError: Cannot convert undefined or null to object" #142

Open NatNiM opened 2 years ago

NatNiM commented 2 years ago

Describe the bug vue.runtime.esm.js?c320:3020 TypeError: Cannot convert undefined or null to object at Function.keys () at mergeConfig (vue-dadata.esm.js?4d05:3845:1) at Axios.request (vue-dadata.esm.js?4d05:3964:1) at Axios. [as post] (vue-dadata.esm.js?4d05:4065:1) at Function.wrap [as post] (vue-dadata.esm.js?4d05:428:1) at getSuggestions (vue-dadata.esm.js?4d05:4307:1) at VueComponent.fetchSuggestions (vue-dadata.esm.js?4d05:4507:1) at VueComponent.onInputChange (vue-dadata.esm.js?4d05:4439:1) at invokeWithErrorHandling (vue.runtime.esm.js?c320:2988:1) at HTMLInputElement.invoker (vue.runtime.esm.js?c320:1781:1)

To Reproduce

<VueDadata
      placeholder="Start typing an address"
        classes="address-component"
        :token="token"
        :onChange="sendAddress"
        v-model="query"
        :locationOptions="locations"/>

data(){
    const query = '';
    return {
        query,
        token: "kvivrijrieurbnunuybite",
        locations: {
          language: "ru",
          locations: [{country: "*"}]
        }
      }
  },
  methods: {
    sendAddress: function(suggestion) {
      const data = suggestion.data;
      this.$emit("show:address", data);
    },
  }

Desktop (please complete the following information):

Additional context Error when entering address (dadata version 2) code