firebase / genkit

An open source framework for building AI-powered apps with familiar code-centric patterns. Genkit makes it easy to integrate, test, and deploy sophisticated AI features to Firebase or Google Cloud.
Apache License 2.0
590 stars 68 forks source link

Improve error messages when PROJECT ID is missing #136

Open peterfriese opened 3 months ago

peterfriese commented 3 months ago

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

avolkovi commented 1 month ago

google-auth-library is owned by OAuth team, not something Firebase manages, maybe better file the request with them?