firebase deploy return an empty object {}
See original GitHub issue[REQUIRED] Environment info
“firebase-admin”: “^8.10.0”,
“firebase-functions”: “^3.6.1”
firebase tools: 8.4.2 node version: v12.16.3
Windows 10 OS VS code
Platform:
[REQUIRED] Test case
As i am an absolute newbie in programming and development, i ahve followed the firebase youtube channel to try to use firebase cloud functions. So on the second video i ahve created the function in TS. Convereted it into JS. Deployed it and it works fine i.e. i can see the data from doc. So the next step was to use “firebase serve” instead of deploy. I have followed everything, but whne i use curl with the localhost link or even jsut a pure link, the output is an empty object {}.
[REQUIRED] Steps to reproduce
This is my code:
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
admin.initializeApp()
export const getTask = functions.https.onRequest((request, response) => {
admin.firestore()
.collection('Rooms')
.doc('RRN')
.collection('Alpha')
.doc('Task1')
.get()
.then(snapshot => {
const data = snapshot.data()
response.send(data)
})
.catch(error => {
//Handle erroor
console.log(error);
response.status(500).send(error)
})
});
[REQUIRED] Expected behavior
Expected to return the data from the doc.
[REQUIRED] Actual behavior
instead, i jsut get this: {}
Any help guyz???
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Firebase cloudfunction functions.config() returns an empty ...
I'm trying to access the token stored in functions.config().fb.token but functions.config() returns an empty object. To create the token I've ...
Read more >Get started: write, test, and deploy your first functions - Firebase
When you initialize Firebase SDK for Cloud Functions, you create an empty project containing dependencies and some minimal sample code, and you choose ......
Read more >Troubleshooting | Cloud Storage
Run gcloud storage ls --recursive gs://www.example.com/dir/ . If the output includes http://www.example.com/dir/ , you have an empty object at that location.
Read more >Special Checks | Mendix Documentation
2 Checking for an Empty Object. Checks if an object is empty. ... Returns whether the object is empty, Boolean ...
Read more >Empty - Firebase Hosting | AnyAPI Documentation
For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }. The JSON representation for Empty is empty JSON object {} .
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
Very glad it worked, thanks for your patience!
Hi @samtstern . I have fixed the issue with python not found.
After i have run your suggested command, i run firebase serve, then curl given-link and now i receive the right object back
Thanks a lot for your help guyz @samtstern @joehan Appreciate it a lot.