genkit-ai / genkit-ai/genkit

Improve error messages when PROJECT ID is missing

Open
#136 2 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

feature
Dominant language
TypeScript
Stars
6.5k
Forks
845
Avg merge
4d 4h
Merged PRs (30d)
58

Description

When running the Menu sample without a GCP project set up, the error message issued by the Vertex plugin is not intuitive:

Initializing plugin vertexai:
/Users/peterfriese/Workspace/Projects/Incubation/Genkit/genkit/js/node_modules/.pnpm/google-auth-library@9.7.0_encoding@0.1.13/node_modules/google-auth-library/build/src/auth/googleauth.js:147
            throw new Error(GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND);
                  ^

Error: Unable to detect a Project Id in the current environment.
To learn more about authentication and Google APIs, visit:
https://cloud.google.com/docs/authentication/getting-started
    at GoogleAuth.findAndCacheProjectId (/Users/peterfriese/Workspace/Projects/Incubation/Genkit/genkit/js/node_modules/.pnpm/google-auth-library@9.7.0_encoding@0.1.13/node_modules/google-auth-library/build/src/auth/googleauth.js:147:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.5.1
Error: Code failed to load, please check log messages above.

Can we issue an error message that points the user at setting up a Google Cloud project, and connecting it via gcloud config set project

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.