Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'x' of undefined #191

Open
lewymati opened this issue May 29, 2024 · 2 comments
Open

Cannot read property 'x' of undefined #191

lewymati opened this issue May 29, 2024 · 2 comments
Labels
bug Something isn't working draw

Comments

@lewymati
Copy link

lewymati commented May 29, 2024

I observed that with streamlit_folium==0.20.0 the draw plugin sometimes breaks (usually after rerendering the map).
In console I could see a lot Cannot read property 'x' of undefined js errors.

To me the issue resembles the one here: vue-leaflet/vue-leaflet#144
It seems its relevant how the leaflet is imported, see this comment

I suspect that the culprit is #181, as after downgrading to streamlit_folium==0.19.1, the issue was no longer there.

(for reference, I use:
streamlit==1.34.0
folium==0.16.0
)

@randyzwitch
Copy link
Owner

Thanks for reporting... @hansthen, would you have any insight here about why this might happen? The comment listed references adding :use-global-leaflet="true", but not being a leaflet expert I'm not sure what the behavior is here.

@randyzwitch randyzwitch added draw bug Something isn't working labels May 29, 2024
@hansthen
Copy link
Contributor

Funny, I had a problem with the Draw plugin in the 0.19 versions, also with undefined errors and 0.20 fixed it for me.

I checked locally, but I was unable to reproduce the issue. My first instinct would be that the reported error from "vue-leaflet" is a red herring. There are many ways an undefined error can occur. However, without being able to reproduce it locally, I cannot come to any firm conclusions.

@lewymati can you add a small code sample that (at least sometimes) demonstrates this issue? You say it happens after a redraw of the map. What did you do to trigger a redraw? Also what browser are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working draw
Projects
None yet
Development

No branches or pull requests

3 participants