0👍
The problem is that you establish a connection to listen on values for your collection, and at the moment you try to access the this.markerCoordinates
it is empty (so this error is because the lifecycle and asynchronous handling). There are some solutions here:
- Move your Firebase listener (
created
hook) to the onmounted
hook and then call the code you have in themounted
lifecycle hook (you can create a separate method for this and call it oncethis.markerCoordinates
is not empty) - I see you are using Vuefire bindings, you should stick to how the structure is suggested there
Source:stackexchange.com