Closed iNeoO closed 1 month ago
Hi !
I tried to get every info so you can better understand the error, where it comes from, and how to fix it :
The error seems to be thrown from Leaflet in Layer.removeLayer by Util.stamp (Layer is a class extended by Marker, Map and pretty much every Leaflet component).
This line seems to throw an error because the object given is undefined.
Vue Leaflet runs some code when a component is unmounted, including this line which call removeThisLayer. This is a function defined on component setup that calls Layer.removeLayer
and gives the current component's leafletObject in parameter.
This means the leafletObject ref from LMap/LMarker gives a .value
of undefined when unmounting the component.
This seems related to https://github.com/vue-leaflet/vue-leaflet/issues/52 which mention the onUnmounted code being called twice for some reason.
From what I understand of your codebase, code such as the inline map here or slotted map here are using v-if
to show the map only if an address is defined.
As mentioned here, potential fixes you could try are : using v-show
, moving the statements directly to childrens ...
Ok i find a way with some v-show, thx
In fact removing all v-if v-show doesn´t fix the problem :/
removeLayer is called with no params at the loading creating the error
Could also be related to https://github.com/vue-leaflet/vue-leaflet/issues/340
Definitely an issue from Vue Leaflet, so I guess it should be opened on Vue Leaflet repo. As Vue Leaflet development seems "paused" (no release for a year) I'll see if I can get my hands on it to help fixing it.
For the moment i will just hide component on pages with trouble to merge my branch I would be very interested if a solution is found.
If no solution can be found in decent times, maybe it's also worth trying https://gugustinette.github.io/nuxt-maplibre/ which could work better.
They also support markers : https://indoorequal.github.io/vue-maplibre-gl/examples/marker.html
Ah really thx, maybe we will give a try to this, i will talk about it with other ppl Thx !
Hi got a problem with the integration of the module
got a pb on this repo
https://github.com/SocialGouv/vao
With https://github.com/SocialGouv/vao/blob/feat/502/packages/frontend-bo/src/pages/hebergements/%5Btype%5D/%5BhebergementId%5D.vue
or https://github.com/SocialGouv/vao/blob/feat/502/packages/frontend-bo/src/pages/hebergements/%5Btype%5D/%5BdemandeSejourId%5D/%5BhebergementId%5D.vue
Switching between these page and going back on the same page create this problem
Maybe i'm doing wrong, any idea why the unmounted is wrongly executed ?