Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

279
Visualizações
Firebase Cloud Function Emulator error with Expo / React Native

I am developing a React Native app using Expo SDK 43 and Firebase 9.6.1, and my app can't call cloud functions running locally in the FB emulator. It can successfully call cloud functions if I deploy them to production, verified by checking the FB logs. Here's the relevant code:

import { initializeApp } from 'firebase/app';
import { connectFunctionsEmulator, getFunctions, httpsCallable } from 'firebase/functions';
import Constants from 'expo-constants';
import firebaseConfig from './firebaseConfig';

const app = initializeApp(firebaseConfig);

const functions = getFunctions(app);

const host = `http://${Constants.manifest.debuggerHost.split(':')[0]}`;
const port = 5001;
connectFunctionsEmulator(functions, host, port);

const helloWorld = httpsCallable(functions, 'helloWorld');
helloWorld();

The console shows:

[Unhandled promise rejection: FirebaseError: internal]
at http://192.168.1.166:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&minify=false:173824:321 in _createSuperInternal
at node_modules/@firebase/util/dist/index.esm2017.js:538:139 in createMockUserToken
at http://192.168.1.166:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&minify=false:188248:321 in _createSuperInternal
at node_modules/@firebase/auth/dist/rn/phone-1d904137.js:7922:16 in tslib.__generator$argument_1
at node_modules/@firebase/auth/dist/rn/phone-1d904137.js:7995:0 in <global>
at http://192.168.1.166:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&minify=false:188924:37 in call$

It's getting the right IP address and port, and, in fact, I can visit the URL in the browser (http://192.168.1.166:5001/MY-PROJECT/us-central1/helloWorld) and see that it's being called in the FB emulator UI. I just can't get the app to do it.

I've been able to use the function emulator before with an older Expo SDK and FB 8, but I'd prefer to stick with what I've got.

Here's the code for the actual cloud function, although I don't think it matters:

import * as functions from 'firebase-functions';

export const helloWorld = functions.https.onCall((data, context) => {
  console.log('something ran');
  console.log(data);
  return data;
});
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda