Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

96
Views
Vue and Firebase not sending data

I'm making an app that counts the user-visiting number. I'm using vue.js 3 and firebase.

For now, I'm testing by sending data to firebase. But it has error"firebase.database is not a function" Can someone help this

import db from './db';

export default {
  name: 'App',

  methods:{

    incrementNum(){
      const numRef = db.database().ref("messages")
      
      numRef.push('hi');
      console.log('sent it')
    },

   
  },
}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The push() method returns a promise. Try an async method:

import db from './db';

export default {
  name: 'App',

  methods:{
    async incrementNum() {
    // ^^ async
      const numRef = db.database().ref("messages")
      await numRef.push('hi');
      // ^^ await
      console.log('sent it')
    },
  },
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!