MadimetjaShika / vuetify-google-autocomplete

A Vuetify ready Vue.js autosuggest component for the Google Places API.
https://madimetjashika.github.io/vuetify-google-autocomplete/
MIT License
97 stars 53 forks source link

The computed property "fields" is already defined as a prop #91

Open butaminas opened 4 years ago

butaminas commented 4 years ago

Gettings this whenever I init the autocomplete field.

I don't have any computed properties by the name "fields". But if I change "fields" prop to something else, I no longer get this error.

bhavinichauhan-kombee commented 4 years ago

We are getting the same error. Does anyone has the solution to this.?

MadimetjaShika commented 4 years ago

Hi guys, please could you share some sample code which causes the error you're observing? I'm having trouble reproducing this error.

bhavinichauhan-kombee commented 4 years ago

This is only the vue warning. Whenever the google autocomplete is initialized. We are getting this error in the console.

"vue": "^2.6.11", "vue-template-compiler": "^2.6.11", "vuetify": "^2.1.15", "vuetify-google-autocomplete": "^2.0.0-beta.6",

Screenshot from 2019-12-31 12-31-32

MadimetjaShika commented 4 years ago

Hi @Bhavini30 , please update to v2.0.0-beta.8 or v2.0.0 (which i've published today). There potentially could've been a problem with v2.0.0-beta.6.

@butaminas, please confirm if you're also using the same versions as mentioned by @Bhavini30, and confirm if updating to the latest version helps.

bhavinichauhan-kombee commented 4 years ago

Hi @MadimetjaShika , I have updated the vuetify-google-autocomplete version to v2.0.0-beta.8 or v2.0.0. But still I am facing the same error.

MadimetjaShika commented 4 years ago

That's pretty odd. Can you share some sample code or repo that causes the warning? I'm having a hard time reproducing that warning, it's also not present on the example app as in the screenshot below - specifically on initialisation.

Screenshot 2020-01-01 at 09 16 12

If I may also suggest, please have a look in your node_modules folder and ensure that the version of vuetify-google-autocomplete in there is actually 2.0.0 (check the package.json file), and that you aren't possibly running a stale version, alternatively delete the node_modules folder and run your dependency install without cache, e.g. npm install --no-cache. I see you're also using Laravel, please make sure that the static built assets are also not stale after your install.

butaminas commented 4 years ago

@MadimetjaShika

I also use the latest version. As a workaround, I am now using this plugin as a local component and I changed the "fields" prop to returnFields. This way I don't get the error anymore.

bryanlampert commented 4 years ago

I've been receiving this error in the console as well. Just updated to 2.0.0 and the error still persists.

MadimetjaShika commented 4 years ago

Hi guys,

It's difficult to assist without some code examples. Please share some code examples on how you're using this library so I can reproduce the problem. Or share a reproduction repo.

mayank30 commented 4 years ago

Hi Guys, Also facing the same issue, with latest version, we are using vuetify and some other dependency suddenly observe the same error.

image

Vue.use(VuetifyGoogleAutocomplete, {
  apiKey: googleAPIKey
});

@Component({
  name: "googleAddress",
  inject: ["$validator"],
  data() {
    return {
      address: "",
      city: "",
      state: "",
      country: "",
      isDisabled: true,
      addressComponents: {
        country: "",
        state: "",
        city: ""
      }
    };
  },
  props: {
    error: {
      type: String
    },
    prefix: {
      type: String
    },
    suffix: {
      type: String
    },
    label: {
      type: String
    },
    helpText: {
      type: String
    },
    type: {
      type: String,
      default: "text"
    },
    required: {
      type: Boolean
    },
    disabled: {
      type: Boolean,
      default: false
    },
    placeholder: {
      type: String
    },
    name: {
      type: String
    },
    minlength: {
      type: String
    },
    maxlength: {
      type: String
    },
    add: {
      type: Object,
      default: () => ({
        addressStr: "",
        address: {
          country: "",
          city: "",
          state: ""
        }
      })
    }
  },
  created() {
    this.$validator = this.$parent.$validator;
  }
})
-------------

<vuetify-google-autocomplete
          id="map"
          types="establishment"
          :placeholder="placeholder"
          v-on:placechanged="getAddressData"
          :country="countriesPermitted"
          v-model="address"
        ></vuetify-google-autocomplete>
nathany commented 4 years ago

I was seeing this warning in the Chrome console after upgrading to v2.0.1 using the latest Vue 2.6.11 and Vuetify 2.2.12.

However, the npm install --no-cache tip worked! Thanks.

nathany commented 4 years ago

Spoke too soon. The warning is back. May have disappeared for some other reason, as I'm still in the midst of updating Vuetify (the warning was there before I started).

kempsteven commented 4 years ago

Any news to this one? Version:2.0.1

here is a code sample

<vuetify-google-autocomplete
     id="map"
      v-on:placechanged="getAddressData"
      placeholder="Please type your address"
      country="sg"/>