Vue2Leaflet icon indicating copy to clipboard operation
Vue2Leaflet copied to clipboard

Tooltip issue in BeforeDestroy hook

Open DmitriyVTitov opened this issue 5 years ago • 4 comments

Hello Mickaël, you did a great job, but I still have an issue similar to #195.

[Vue warn]: Error in beforeDestroy hook: "TypeError: this._map is null" found in <LTooltip> <LMarker> <LLayerGroup> <LMap>

TypeError: "this._map is null" removeInteractiveTarget leaflet-src.js:6460 closeTooltip leaflet-src.js:10292 unbindTooltip leaflet-src.js:10215 beforeDestroy vue2-leaflet.min.js:1 invokeWithErrorHandling21VueJS

invokeWithErrorHandling callHook destroy destroy invokeDestroyHook invokeDestroyHook patch destroy destroy invokeDestroyHook removeVnodes updateChildren patchVnode patch _update updateComponent get run flushSchedulerQueue nextTick flushCallbacks

I got this error when my data changes or when map is destroyed. I have v-if condition for <l-marker>. The code looks like:

        <l-layer-group
          v-if="stops != null && stops.Fwd !== null"
          layer-type="overlay"
          name="Bus stops"
        >
          <l-marker
            v-for="item in fwdStops"
            :key="item.Key"
            :lat-lng="item.Pos"
            :icon="$iconStopFwd"
          >
            <l-popup>№: {{item.Num}} - {{item.Name}}</l-popup>
            <l-tooltip :options="{permanent: true, interactive: true}">{{item.Num}}</l-tooltip>
          </l-marker>
        </l-layer-group>

I have several maps in my app and all have same bug.

Browsers Affected

  • [x] Chrome
  • [x] Firefox
  • [ ] Edge
  • [ ] Safari 9
  • [ ] Safari 8
  • [ ] IE 11

Versions

  • Leaflet: v1.4.0
  • Vue: v2.6.10
  • Vue2Leaflet: v2.0.2

DmitriyVTitov avatar Mar 28 '19 13:03 DmitriyVTitov

Here is what Chrome says:

[Vue warn]: Error in beforeDestroy hook: "TypeError: Cannot read property '_targets' of null"

found in

---> <LTooltip> <LRotatedMarker> <LLayerGroup> <LMap> <MonitoringMain> at src/components/Monitoring/Main.vue <Monitoring> at src/views/Monitoring.vue <App> at src/App.vue <Root> warn @ vue.runtime.esm.js?2b0e:619 logError @ vue.runtime.esm.js?2b0e:1883 globalHandleError @ vue.runtime.esm.js?2b0e:1878 handleError @ vue.runtime.esm.js?2b0e:1839 invokeWithErrorHandling @ vue.runtime.esm.js?2b0e:1861 callHook @ vue.runtime.esm.js?2b0e:4194 Vue.$destroy @ vue.runtime.esm.js?2b0e:3953 destroy @ vue.runtime.esm.js?2b0e:3152 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6079 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6084 patch @ vue.runtime.esm.js?2b0e:6432 Vue.$destroy @ vue.runtime.esm.js?2b0e:3976 destroy @ vue.runtime.esm.js?2b0e:3152 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6079 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6084 patch @ vue.runtime.esm.js?2b0e:6432 Vue.$destroy @ vue.runtime.esm.js?2b0e:3976 destroy @ vue.runtime.esm.js?2b0e:3152 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6079 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6084 patch @ vue.runtime.esm.js?2b0e:6432 Vue.$destroy @ vue.runtime.esm.js?2b0e:3976 destroy @ vue.runtime.esm.js?2b0e:3152 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6079 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6084 patch @ vue.runtime.esm.js?2b0e:6432 Vue.$destroy @ vue.runtime.esm.js?2b0e:3976 destroy @ vue.runtime.esm.js?2b0e:3152 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6079 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6084 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6084 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6084 patch @ vue.runtime.esm.js?2b0e:6432 Vue.$destroy @ vue.runtime.esm.js?2b0e:3976 destroy @ vue.runtime.esm.js?2b0e:3152 invokeDestroyHook @ vue.runtime.esm.js?2b0e:6079 removeVnodes @ vue.runtime.esm.js?2b0e:6095 updateChildren @ vue.runtime.esm.js?2b0e:6200 patchVnode @ vue.runtime.esm.js?2b0e:6284 patch @ vue.runtime.esm.js?2b0e:6447 Vue._update @ vue.runtime.esm.js?2b0e:3923 updateComponent @ vue.runtime.esm.js?2b0e:4041 get @ vue.runtime.esm.js?2b0e:4444 run @ vue.runtime.esm.js?2b0e:4519 flushSchedulerQueue @ vue.runtime.esm.js?2b0e:4275 (anonymous) @ vue.runtime.esm.js?2b0e:1979 flushCallbacks @ vue.runtime.esm.js?2b0e:1905 Promise.then (async) timerFunc @ vue.runtime.esm.js?2b0e:1932 nextTick @ vue.runtime.esm.js?2b0e:1989 queueWatcher @ vue.runtime.esm.js?2b0e:4367 update @ vue.runtime.esm.js?2b0e:4509 notify @ vue.runtime.esm.js?2b0e:730 reactiveSetter @ vue.runtime.esm.js?2b0e:1055 (anonymous) @ vue-router.esm.js?8c4f:2503 (anonymous) @ vue-router.esm.js?8c4f:2502 updateRoute @ vue-router.esm.js?8c4f:1989 (anonymous) @ vue-router.esm.js?8c4f:1867 (anonymous) @ vue-router.esm.js?8c4f:1976 step @ vue-router.esm.js?8c4f:1706 step @ vue-router.esm.js?8c4f:1713 runQueue @ vue-router.esm.js?8c4f:1717 (anonymous) @ vue-router.esm.js?8c4f:1971 step @ vue-router.esm.js?8c4f:1706 (anonymous) @ vue-router.esm.js?8c4f:1710 (anonymous) @ vue-router.esm.js?8c4f:1956 (anonymous) @ vue-router.esm.js?8c4f:1784 iterator @ vue-router.esm.js?8c4f:1935 step @ vue-router.esm.js?8c4f:1709 step @ vue-router.esm.js?8c4f:1713 (anonymous) @ vue-router.esm.js?8c4f:1710 (anonymous) @ vue-router.esm.js?8c4f:1956 (anonymous) @ main.js?56d7:132 iterator @ vue-router.esm.js?8c4f:1935 step @ vue-router.esm.js?8c4f:1709 step @ vue-router.esm.js?8c4f:1713 runQueue @ vue-router.esm.js?8c4f:1717 confirmTransition @ vue-router.esm.js?8c4f:1964 transitionTo @ vue-router.esm.js?8c4f:1866 push @ vue-router.esm.js?8c4f:2267 push @ vue-router.esm.js?8c4f:2529 handler @ vue-router.esm.js?8c4f:444 invokeWithErrorHandling @ vue.runtime.esm.js?2b0e:1854 invoker @ vue.runtime.esm.js?2b0e:2178 original._wrapper @ vue.runtime.esm.js?2b0e:6880 Show 54 more frames

DmitriyVTitov avatar Apr 10 '19 01:04 DmitriyVTitov

@DmitriyVTitov I am working on this

DonNicoJs avatar Apr 26 '19 07:04 DonNicoJs

hey, is anybody going to fix it?

mrosminin avatar Sep 13 '19 09:09 mrosminin

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 01 '20 12:01 stale[bot]