-
Notifications
You must be signed in to change notification settings - Fork 986
Description
Operating System
Windows 11 Home 23H2
Browser Version
Google Chrome Version 124.0.6367.208
Firebase SDK Version
10.11.0
Firebase SDK Product:
Functions
Describe your project's tooling
React app with Webpack and Jest
Describe the problem
I'm trying to call a callable function. but the client cannot reach the cloud function code.
This is because the code hangs at
@firebase/functions/src/service.ts > callAtURL (line 280):
const context = await functionsInstance.contextProvider.getContext(
options.limitedUseAppCheckTokens
);
As a result, the network call is never made.
I can hit the function on the server using a barebones fetch or Postman, and it works perfectly.
I've posted about this issue on Stackoverflow previously: https://stackoverflow.com/questions/77122626/firebase-callable-functions-not-making-a-network-call-from-frontend-promise-nev
Steps and code to reproduce issue
I'm not certain why this happened in my environment. My reproduction steps are
- create a new project
- download firebase^@10.11.0
- write and deploy a callable function, on the server
- import httpsCallable on the client
- attempt to call the server from the client via the httpsCallable
Result: the code hangs and never returns. No network call is made.
My code:
CLIENT
import { getFunctions, httpsCallable } from "firebase/functions";
const functions = getFunctions(firebaseApp);
const viewInvoice = httpsCallable(functions, 'testOnCall');
const result = await viewInvoice({ "test": "testy" })
BACKEND
const { onCall } = require("firebase-functions/v2/https");
exports.testOnCall = onCall((request) => {
console.log("request is ", request)
return true
})