owntracks / frontend

🌍 Web interface for OwnTracks built with Vue.js
MIT License
386 stars 53 forks source link

Doesn't load map element #89

Closed atjn closed 2 years ago

atjn commented 2 years ago

I am running a fairly standard setup where the frontend is served by Caddy on https://[host]/frontend. I have not changed any config settings.

When I open the app, everything works as expected, except that the map is missing. The entire div.vue2leaflet-map element is just never added to the DOM.

I have tested this against the official docker.io/owntracks/frontend image, which does load the map. My setup loads the exact same resources as the official one, and I have no server errors, no console errors, all the information from the server is loaded correctly. In other words, as far as I can tell, the app is working perfectly fine.

Here's a quick video of what the app looks like: frontend.webm

My setup is also running in a Docker container, and you can check out the configuration here: https://github.com/atjn/docker-easy-owntracks/blob/d8d06a7a89c6f3029809314760a565c3eccd3435/Dockerfile#L36

I see the same issue in both Firefox and Edge.

Do you have any idea what is going on here? Any help is much appreciated, thanks!

linusg commented 2 years ago

Same as https://github.com/owntracks/frontend/issues/58 perhaps? (and by extension, https://github.com/owntracks/frontend/issues/32)

Judging by your Caddyfile you deploy the frontend at /frontend/, and since the app uses a client-side router that renders the map view at / relative to the router.basePath config, you'll need to change that.

linusg commented 2 years ago

(this seems unnecessary at first given the frontend still only has a single page, but was done in anticipation of adding different view types at different URLs - e.g. / is the map, /devices lists devices, etc. - just haven't made use of that yet)

linusg commented 2 years ago

Relevant part of the config docs: https://github.com/owntracks/frontend/blob/main/docs/config.md#routerbasepath

atjn commented 2 years ago

I changed the basePath and the map is now loading correctly. Thank you very much!

paclg commented 1 year ago

Ahhh I lost some hours on this, :-( but it's ok now, thank you for your nice work 👍