[Vuejs]-Vuejs + firebase data push

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:

  1. Move your Firebase listener (created hook) to the on mounted hook and then call the code you have in the mounted lifecycle hook (you can create a separate method for this and call it once this.markerCoordinates is not empty)
  2. I see you are using Vuefire bindings, you should stick to how the structure is suggested there

Leave a comment