jperelli / vue2-leaflet-polylinedecorator

polylinedecorator plugin extension for vue2-leaflet package
MIT License
5 stars 4 forks source link

o.default.polylineDecorator is not a function #2

Open wishinghand opened 5 years ago

wishinghand commented 5 years ago

Anyone seen this error crop up? Everything was working fine until it wasn't. I haven't upgraded any Leaflet packages, though I recently did update Vue and vue-template-compiler to match each other's version. Everything on my Leaflet map works fine except for the arrowheads that I'm drawing with this polyline decorator. Error is as follows:

[Vue warn]: Error in mounted hook: "TypeError: o.default.polylineDecorator is not a function"

I'm importing this package like so: import GateArrow from 'vue2-leaflet-polylinedecorator'

and using it here:

<gate-arrow
  :paths="gate.coordinates"
  :patterns="arrowPattern"
/>

Where paths is a two pairs of coordinates for a line segment to be the arrow body, and patterns is the arrowhead, defined as:

arrowPattern: [{
  offset: '100%',
  repeat: 0,
  symbol: L.Symbol.arrowHead({
    pixelSize: 15,
    polygon: false,
    pathOptions: { stroke: true }
  })
}]
jperelli commented 5 years ago

which vue version are you using?

wishinghand commented 5 years ago

Sorry, forgot that important detail. Vue: 2.5.22 Vue2Leaflet: 1.0.2 vue2-leaflet-polylinedecorator: 2.0.1

wishinghand commented 5 years ago

Switching from Yarn to NPM seemed to have solved this, though no idea why it did.

MrJSdev commented 4 years ago

I am having same issues, I don't know why?

gaspo53 commented 4 years ago

Same here, guys. Using yarn on this case: vue.runtime.esm.js?2b0e:1888 TypeError: o.default.polylineDecorator is not a function at VueComponent.mounted (Vue2LeafletPolylinedecorator.js?1cdc:1) at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854) at callHook (vue.runtime.esm.js?2b0e:4219) at Object.insert (vue.runtime.esm.js?2b0e:3139) at invokeInsertHook (vue.runtime.esm.js?2b0e:6346) at VueComponent.patch [as __patch__] (vue.runtime.esm.js?2b0e:6565) at VueComponent.Vue._update (vue.runtime.esm.js?2b0e:3948) at VueComponent.updateComponent (vue.runtime.esm.js?2b0e:4066) at Watcher.get (vue.runtime.esm.js?2b0e:4479) at Watcher.run (vue.runtime.esm.js?2b0e:4554)

Cheerwhy commented 3 years ago

I am having same issues, I don't know why?

use npm instead of yarn

Cheerwhy commented 3 years ago

不要用cnpm