genkit icon indicating copy to clipboard operation
genkit copied to clipboard

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

Open pavelgj opened this issue 1 year ago • 1 comments

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/[email protected]/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.

pavelgj avatar Jun 21 '24 13:06 pavelgj

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

cvanputt avatar Jul 15 '24 19:07 cvanputt