Skip to content

callAtURL > functionsInstance.contextProvider.getContext never returns #8267

@daedwards767

Description

@daedwards767

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

  1. create a new project
  2. download firebase^@10.11.0
  3. write and deploy a callable function, on the server
  4. import httpsCallable on the client
  5. 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
})

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions