geospoc / v-mapbox-geocoder

Wrapper for vue-mapbox-geocoder

Home Page:https://v-mapbox-geocoder.geospoc.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read property 'marker' of undefined

alexaderramos opened this issue · comments

following the example of the documentation Usage
I have this error, even setting the prop maked to false

`

/**
 * A mapbox-gl instance to use when creating Markers.
 * Required if options.marker is true.
 */
mapboxgl: {
  type: Object,
  "default": null,
  required: undefined.marker
},

`

required: undefined.marker

Looks like the author has already identified the issue: #141

@vinayakkulkarni, oh. I’ve commented #141 but actually should commented this one. I hoped that this issue will be fixed in the commit you have mentioned, but unfortunately, the issue is still occurring.

After a short research I’ve found a Stack overflow topic ‘Can required if in vue props?’ https://stackoverflow.com/questions/50098716/can-required-if-in-vue-props where a watch is suggested instead. Are you sure that solution with undefined.marker or this.marker is working? (the first one with undefined used is obviously bad but I’ve mentioned it for the sake of completeness). I have tested it locally on my computer and it is not working correctly unless I have remove that dependency on another prop value at all.