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

385
Views
[Advertencia de Vue]: error en el controlador v-on: "TypeError: Object (...) (...). httpsCallable (...). Entonces no es una función"

Estoy tratando de llamar a estas funciones de nube de firebase desde mi aplicación Vue

 exports.sayHi = functions.https.onCall((data, context) =>{ return "hi"; });

Esta es mi acción en la tienda.

 import { getFirebaseDB, getFirebaseFunctions, } from "../../helpers/firebase/authUtils"; reserveApt() { getFirebaseFunctions() .httpsCallable("sayHi") .then((result) => { console.log(result); }); },

y estas son mis funciones auxiliares en ../../helpers/firebase/authUtils:

 import firebase from "firebase/app"; import "firebase/auth"; import "firebase/firestore"; import "firebase/functions"; /** * Initilize the backend * @param {*} config */ const initFirebaseBackend = (config) => { if (!_fireBaseBackend) { _fireBaseBackend = new FirebaseAuthBackend(config); _db = firebase.firestore(); _functions = firebase.functions(); } return _fireBaseBackend; }; /** * Returns the firebase backend */ const getFirebaseBackend = () => { return _fireBaseBackend; }; /** * returns firestore db */ const getFirebaseDB = () => { if (!_db) { _db = firebase.firestore(); } return _db; }; /** * returns firebase functions */ const getFirebaseFunctions = () => { if (!_functions) { _functions = firebase.functions(); } return _functions; }; export { initFirebaseBackend, getFirebaseBackend, getFirebaseDB, getFirebaseFunctions, };

Firebase se inicializó correctamente y todas las demás funciones, como auth y firestore, funcionan perfectamente, pero cuando llamo a esto, aparece este error:

 [Vue warn]: Error in v-on handler: "TypeError: Object(...)(...).httpsCallable(...).then is not a function" found in ---> <Properties> at src/views/pages/property/properties.vue <App> at src/App.vue <Root>
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Así que aparentemente el problema estaba en llamar a la función. Tuve que llamarlo así:

 var reserve = getFirebaseFunctions().httpsCallable("sayHi"); reserve().then((result) => { console.log(result); });

pero no estoy seguro de por qué!!

over 4 years ago · Santiago Trujillo 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!