The Firebase Cloud Function assigned to a specific region is currently experiencing functionality issues

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!

Answer №1

The code you've exported in firebase.js is firebase.functions(). This is causing an error because it's being called as a function in the importing code. The correct way to handle this is to export firebase.functions, which is the proper function for initialization with a region.

Alternatively, you can export

firebase.functions("europe-west3")
and use it in the importing code as functions.httpsCallable().

It's worth noting that there is a typo in your region string.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How come attempting to read a nonexistent document from Firestore results in an uncaught promise?

I've been struggling to read and display data from Firestore, but I keep seeing error messages in the console. Encountered (in promise) a TypeError: Unable to read properties of undefined (reading 'ex') Encountered (in promise) a TypeError ...

Utilize jQuery to extract all values from the second cell of a table and store them in an array

I have a task that involves pushing numbers from text boxes into an array. These text boxes are located in the second cell of each table row, while the third cell contains a date picker. Currently, the code snippet provided retrieves all values from both ...

Fastify endpoint failing to respond to designated URL

Within my code, there is a router setup: fastify.get('/:link', (req, reply) => { req.params.url = req.host+req.url; reply.view("template.ejs",req.params); }); I am trying to capture URLs and process them in the template. All URLs are ...

Looking for assistance with creating a smooth fade-in effect in a video using ffmpeg with Node.js?

I'm attempting to add a fade-in effect to a video in Node.js using ffmpeg. I've made an attempt but so far, I haven't been successful. I could use some help implementing this effect into my video. Here's my code: var ffmpeg = require( ...

Having trouble converting Buffered Byte Array into Image in Browser

Hello there! I am currently facing an issue while attempting to generate an image from a buffered byte array. The reason behind this is that I need to transfer the image from the server to the client using JSON. Below is the code snippet in question: The ...

Assigning a specific data type value to an element as it enters the top of the viewport

I have a unique color code stored for each section, and when a section reaches the top of the screen (specifically -180px for the header), I want to dynamically change the text color of the header element as you scroll through the sections. Despite no erro ...

Unlocking the Mystery of the Tweet Preview Image

Can anyone help me figure out how to extract a Tweet's preview image from its link? I've been using the html-metadata-parser module to get meta tags, but I'm having trouble finding the image tag for tweets on Twitter. Surprisingly, when I sh ...

What is the most efficient way to update a counter when a button is clicked in React and display the result on a different page?

Just delving into the world of React and Javascript, I decided to challenge myself by creating a Magic 8 Ball application. Currently, I have set up two main pages: The magic 8 ball game page A stats page to showcase information about the magic 8 ball qu ...

Utilizing property validation in your codebase

How can I set up my code to display a warning in the console if the value of the Prop is not a string? The player-name prop should always be a string. If this: <greet :player-name="5"></greet> contains a number, I want my code below to generat ...

Repeatedly utilizing a drop-down menu

Can a <select> menu be written and utilized in multiple locations on a webpage? For instance: <select id="dm"> <option value="">Select Quantity</option> <option value="less ">50 - 60</option> <option value="me ...

Obtaining the contents of a local directory with JavaScript

Currently, I am attempting to access the contents of a local folder using JavaScript. Despite my efforts with the Filesystem API, an error is consistently appearing: DOMException: It was determined that certain files are unsafe for access within a Web app ...

Implementing dynamic CSS in AngularJS using conditional statements

One technique I've been using in angularjs involves toggling between two windows using the ng-click and ng-show directives: <div ng-init="showTab2 = false"> <a ng-click="showTab2 = true; showTab1 = false ">#Tab1 </a> ...

Passing objects to all components in Vue/Vuex without explicitly specifying them

Currently, I am working on some analytical tasks and one of the key elements that needs to be accessed by multiple child elements is the 'link position'. Here is an example to illustrate this: <Page> <MyComponent linkPosition=&apo ...

Executing Jquery code inside a PHP function

I am facing an issue with a form on my website where the form entries are not clearing when the submission message is displayed. I believe using Jquery to hide the form entries upon submission would solve this problem. The form in question has the ID of ...

Using the HttpPut method in conjunction with a route controller

Hey there, I could really use some assistance. I'm currently attempting to utilize the PUT Method via AJAX in order to send data to a controller for an update operation. Here's my JavaScript and AJAX code: function UpdateProduct() { var id = loc ...

The function User.find does not exist and it is not possible to replace the `users` model after it has

Currently, I am experimenting with using mongoose, mongoDB, next, and express in a test project. Despite referencing solutions like Cannot overwrite model once compiled Mongoose and others, I am encountering issues unique to my situation. Upon initializat ...

Namespacing is not applied to dynamic modules in Vuex

I've been tackling a modular vue application that enrolls the modules during compile time. Take a look at the code snippet below - app.js import store from './vue-components/store'; var components = { erp_inventory: true, erp_purc ...

What is the best way to create a DOM element listener in AngularJS?

My goal is to monitor a <div id="please_monitor_me"> to determine if it is visible. If it is not visible, I plan to remove the margin (margin: 0;). I am aiming for no margin when the div is not visible so that it can be shown later with a burger but ...

There was an error: Unable to access the 'filter' property of an undefined variable

import React, {PureComponent} from 'react'; import {TextInput} from '../../shared'; import {array} from 'prop-types'; import { EmployeeTable } from '../employeeTable/EmployeeTable'; import './HeaderSearch.scss&a ...

The modal window displays an error upon submission and prevents itself from closing

Below is the HTML code for a modal form: <form action="" class="cd-form" method="POST" id="signinform" onsubmit="return: false;"> <p class="fieldset" id="warningPanel"> <?php ShowAlertWarning(); ?> </p> <p ...