[Error: Internal] when calling a callable cloud function using local emulator
See original GitHub issue[REQUIRED] Environment info
firebase-tools: 7.12.1
Platform: macOS
[REQUIRED] Test case
- Run
firebase emulators:start --only functions
within ProjectName/functions/ - Add
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
],
"source": "functions"
},
"emulators": {
"functions": {
"port": 5001
}
}
}
To firebase.json
- Add
app.functions().useFunctionsEmulator('http://localhost:5001');
after initializing firebase app (e.g.const app = firebase.initializeApp(config);
) - Disable App Transport Security in info.plist (Building ios app using react-native)
- Call callable function from app
[REQUIRED] Steps to reproduce
- Create a callable function and call it using the steps from the test case
[REQUIRED] Expected behavior
The app calls the function and the functions returns the expected response with no Internal server error.
[REQUIRED] Actual behavior
[Error: Internal]
after making the call to the cloud function. Logs do not output anything. console logging on the first line of the cloud function doesn’t output anything, so it doesn’t even get inside the function.
However, if I paste the url generated from the emulator into my browser, the emulator does output logs, which tells me that there’s something wrong with how the app is calling the function.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
FirebaseError:Internal Given While Testing Callable Firebase ...
I am trying to test a callable Firebase cloud function using a Node.js script using the functions emulator, but I keep getting the...
Read more >Call functions from your app | Cloud Functions for Firebase
To use HTTPS callable functions you must use the client SDK for your ... client instead receives an error with the message INTERNAL...
Read more >Cloud Functions | React Native Firebase
Using an emulator. Whilst developing your application with Cloud Functions, it is possible to run the functions inside of a local emulator. To...
Read more >Using Cloud Functions for Firebase - FlutterFire
If you are using the local Cloud Functions emulators, then it is possible to connect to these using the useFunctionsEmulator method. Ensure you...
Read more >Troubleshooting Cloud Functions - Google Cloud
Make sure you specify the name of your function correctly. You can always check using gcloud functions call which returns the correct 404...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@samtstern @JoshLiquornik I found the issue. Since I’m attempting to call the emulated functions on a mobile device, I had to run
firebase serve --only functions -o 0.0.0.0
then useapp.functions().useFunctionsEmulator('http://<local ip>:<port>');
I just forgot that you can’t call localhost functions from other devices…
Thanks for following up! I’ve made that same mistake many times.