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
581 stars 67 forks source link

[Tooling] `genkit start` needs a nicer error message when running in the wrong folder #440

Open pavelgj opened 2 months ago

pavelgj commented 2 months ago

Right now if you run genkit start in a wrong directory you get an error that looks like this:

$ genkit start
/Users/pavelgj/genkit/genkit-tools/common/lib/cjs/runner/runner.js:114
                throw Error(`Unexpected runtime while starting app code: ${runtime}`);
                      ^

Error: Unexpected runtime while starting app code: undefined
    at Runner.startApp (/Users/pavelgj/genkit/genkit-tools/common/lib/cjs/runner/runner.js:114:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Command.<anonymous> (/Users/pavelgj/genkit/genkit-tools/cli/dist/commands/start.js:55:9)
    at async Command.parseAsync (/Users/pavelgj/genkit/genkit-tools/node_modules/.pnpm/commander@11.1.0/node_modules/commander/lib/command.js:936:5)
    at async startCLI (/Users/pavelgj/genkit/genkit-tools/cli/dist/cli.js:66:5)
    at async /Users/pavelgj/genkit/genkit-tools/cli/dist/bin/genkit.js:6:5

Node.js v21.7.3

Would be great if it showed a friendlier message.

cvanputt commented 1 month ago

this confused me for hours. In firebase you cannot run genkit start from the root project folder. cd into the functions folder, run genkit initand it all works