question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firebase deploy and serve give undefined message and nothing more

See original GitHub issue

First and foremost thank you for your help in advance. I’m wetting my feet in the firebase world and read the docs on deploying. This is an existing project and the docs are pretty straight forward on serving and deploying your functions.

However, I am getting an undefined error with not much info… again, I’m new to the firebase world. I’ve tried using different node version, updating to latest firebase libraries, and checking permissions (I think it might be related)

Any help on this would be greatly appreciated. Thanks!

[REQUIRED] Environment info

firebase ^5.11.1 firebase-tools: 7.2.2 firebase-admin: ^8.3.0 firebase-functions ^3.2.0

Platform: macOS

[REQUIRED] Test case

firebase deploy & firebase serve

[REQUIRED] Steps to reproduce

firebase deploy & firebase serve

[REQUIRED] Expected behavior

  • A successful firebase serve & firebase deploy to work

[REQUIRED] Actual behavior

[2019-08-05T21:10:09.224Z] ----------------------------------------------------------------------
[2019-08-05T21:10:09.228Z] Command:       /usr/local/bin/node /usr/local/bin/firebase serve --debug
[2019-08-05T21:10:09.229Z] CLI Version:   7.2.2
[2019-08-05T21:10:09.229Z] Platform:      darwin
[2019-08-05T21:10:09.229Z] Node Version:  v11.14.0
[2019-08-05T21:10:09.230Z] Time:          Mon Aug 05 2019 14:10:09 GMT-0700 (Pacific Daylight Time)
[2019-08-05T21:10:09.230Z] ----------------------------------------------------------------------

[2019-08-05T21:10:09.239Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2019-08-05T21:10:09.239Z] > authorizing via signed-in user
[2019-08-05T21:10:09.239Z] [iam] checking project <project> for permissions ["firebase.projects.get"]
[2019-08-05T21:10:09.241Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/<project>:testIamPermissions  
 permissions=[firebase.projects.get]
[2019-08-05T21:10:09.577Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 05 Aug 2019 21:10:09 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=211, alt-svc=quic=":443"; ma=2592000; v="46,43,39", accept-ranges=none, transfer-encoding=chunked
[2019-08-05T21:10:09.580Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/<project>
 
[2019-08-05T21:10:09.762Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 05 Aug 2019 21:10:09 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43,39", accept-ranges=none, transfer-encoding=chunked

=== Serving from '/Users/Admin/projects/<project>'...

[2019-08-05T21:10:09.768Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/<project>/webApps/-/config  
 
✔  functions: Using node@11 from host.
[2019-08-05T21:10:09.782Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/<project>/adminSdkConfig  
 
[2019-08-05T21:10:09.915Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 05 Aug 2019 21:10:09 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43,39", accept-ranges=none, transfer-encoding=chunked
[2019-08-05T21:10:09.980Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 05 Aug 2019 21:10:09 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43,39", accept-ranges=none, transfer-encoding=chunked
i  hosting: Serving hosting files from: public
✔  hosting: Local server: http://localhost:5000
✔  functions: Emulator started at http://localhost:5001
i  functions: Watching "/Users/Admin/projects/<project>/functions" for Cloud Functions...
[2019-08-05T21:10:10.576Z] [runtime-status] Functions runtime initialized. {"cwd":"/Users/Admin/projects/<project>/functions","node_version":"11.14.0"}
[2019-08-05T21:10:10.576Z] [runtime-status] Disabled runtime features: {"functions_config_helper":true,"network_filtering":true,"timeout":true,"memory_limiting":true,"admin_stubs":true} {}
[2019-08-05T21:10:10.579Z] [runtime-status] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.3.0","resolution":"/Users/Admin/projects/<project>/functions/node_modules/firebase-admin/lib/index.js"}
[2019-08-05T21:10:10.581Z] [runtime-status] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.2.0","resolution":"/Users/Admin/projects/<project>/functions/node_modules/firebase-functions/lib/index.js"}
[2019-08-05T21:10:10.584Z] [runtime-status] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.2.0","resolution":"/Users/Admin/projects/<project>/functions/node_modules/firebase-functions/lib/index.js"}
⚠  undefined
⚠  We were unable to load your functions code. (see above)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
samtsterncommented, Aug 6, 2019

@Mcebrera oh I’m glad you solved it! And I agree, it sounds like this is no longer related to the CLI so I will close it. Both the JS SDK and the Node.js Admin SDK are open source on GitHub though so I would recommend filing an issue over there if you don’t solve this soon.

0reactions
Mcebreracommented, Aug 6, 2019

@samtstern I was able to get passed the undefined error and am no longer seeing it when running serve or deploy. Seems like it needed some file imports that were not there anymore.

However, now I am seeing a database: Firebase: Firebase service named 'database' already registered (app/duplicate-service). error.

I believe this new error is related to the compatibility of firebase and firebase-admin. I am ok with this being closed now that the original error is no longer prevalent and the new error doesn’t seem to be related to firebase-tools.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't deploy firebase functions (Failed to fetch Run service ...
Can't deploy firebase functions. I have two project aliases, its working fine for the first project (dev), but not for the second (prod)....
Read more >
Deploy targets | Firebase Documentation - Google
Configure your firebase.json file to use deploy targets; Manage deploy targets; Test locally before deploying; Deploy specific Firebase resources.
Read more >
Firebase CLI
Deploy code and assets to your Firebase projects; Run a local web server for your Firebase Hosting site; Interact with data in your...
Read more >
Fix error ERR_INVALID_ARG_TYPE deploying to Firebase ...
If you're trying to deploy a website to Firebase hosting and you're ... This might not seem very helpful but with the two...
Read more >
Troubleshooting | Cloud Storage
For example, I see an error message when trying to delete a bucket, but I don't ... Serve your static website content from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found