I'm faced with the challenge of invoking a Firebase Cloud Function that has already been successfully deployed from my Vue.js application. The specific requirement is for the function to be executed in the europe-west3
region.
My approach involves clicking a button which triggers the execution of the call()
method:
<script>
import { functions } from '@/firebase'
export default {
methods: {
call() {
const callFunction = functions('europe-west3').httpsCallable('orgNew') // Error points to this line of code
callFunction( { name: 'John Doe'}).then(result => {
console.log(result.data)
})
}
}
}
</script>
However, my current implementation is failing and I am encountering these errors in the console: https://i.sstatic.net/dHOEy.png
Within my firebase.js
file, I have imported Firebase
and defined some utility functions:
import firebase from 'firebase/app'
import 'firebase/auth'
import 'firebase/firestore'
import 'firebase/functions'
let firebaseConfig = { // API KEYS AND CONFIG };
firebase.initializeApp(firebaseConfig)
var db = firebase.firestore()
const auth = firebase.auth()
const functions = firebase.functions()
export {
db,
auth,
functions
}
Assistance on resolving this issue would be greatly appreciated!