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.

[Error] You may specify one with an environment variable named "GOOGLE_CLOUD_PROJECT"

See original GitHub issue

I have this error. I followed the README.

UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 15) Error: Sorry, we cannot connect to Cloud Services without a project ID. You may specify one with an environment variable named "GOOGLE_CLOUD_PROJECT".

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
guilhermeliriocommented, May 16, 2019

Works!!!

  • Navigate to the Google Cloud Console API & Services page

  • Select Create Credentials and create a Service account key

    1. Select App engine default service account
    2. Rename to defaul-service-key.json and save inside src/ folder, like this: src/default-service-key.json
  • Change src/firestore.ts and replace in lines 25 to 28:

const serviceAccount = require(‘./default-service-key.json’);

admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: https://${googleCloudProjectId}.firebaseio.com, })

  • Run npm run build
  • Run npm run start:local
1reaction
Flekercommented, May 16, 2019

Okay, thanks for verifying the flow. I will have to update the README.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google cloud sdk environment variables - Stack Overflow
I tried running the command from my project, the command is running successfully in Google Cloud shell, but the error seems to be...
Read more >
Use environment variables | Cloud Run Documentation
You can set environment variables using the Google Cloud console, ... and specify the name you want for the variable and its value...
Read more >
Configure your environment | Cloud Functions for Firebase
i functions: Loaded environment variables from .env.projectId. Depending on your development workflow, it may be useful to add the generated .env.
Read more >
Problems with Environment Variables
If you have already set the desired environment variable as described here and the ... Error message = "Environment variable set to non-existent...
Read more >
Error Messages | Maps JavaScript API - Google Developers
However, you may want to notify the site owner if possible. API Key and Billing Errors. Troubleshooting. Under certain circumstances, a darkened map,...
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