{"record":{"id":"62db6cec462ae022","repo":"hasura/graphql-engine","slug":"error-in-selecting-framework-w","errorCode":null,"errorMessage":"error in selecting framework: %w","messagePattern":"error in selecting framework: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/actions_use_codegen.go","lineNumber":142,"sourceCode":"\t}\n\n\to.EC.Spinner.Stop()\n\n\tif o.framework == \"\" {\n\t\t// if framework flag is not provided, display a list and allow them to choose\n\t\tvar frameworkList []string\n\t\tfor _, f := range allFrameworks {\n\t\t\tframeworkList = append(frameworkList, f.Name)\n\t\t}\n\n\t\tsort.Strings(frameworkList)\n\n\t\tnewCodegenExecutionConfig.Framework, err = util.GetSelectPrompt(\n\t\t\t\"Choose a codegen framework to use\",\n\t\t\tframeworkList,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"error in selecting framework: %w\", err))\n\t\t}\n\t} else {\n\t\tfor _, f := range allFrameworks {\n\t\t\tif o.framework == f.Name {\n\t\t\t\tnewCodegenExecutionConfig.Framework = o.framework\n\t\t\t}\n\t\t}\n\n\t\tif newCodegenExecutionConfig.Framework == \"\" {\n\t\t\treturn errors.E(op, fmt.Errorf(\"framework %s is not found\", o.framework))\n\t\t}\n\t}\n\n\thasStarterKit := false\n\n\tfor _, f := range allFrameworks {\n\t\tif f.Name == newCodegenExecutionConfig.Framework && f.HasStarterKit {\n\t\t\thasStarterKit = true","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/actions_use_codegen.go#L124-L160","documentation":"Thrown when util.GetSelectPrompt fails while displaying the interactive list of codegen frameworks (shown because --framework was not passed). Like other prompt helpers, it fails when stdin is not an interactive TTY or the prompt library errors.","triggerScenarios":"Running `hasura actions use-codegen` without --framework in a non-interactive context (CI job, piped stdin, docker without -t).","commonSituations":"Scripted setup of codegen config in CI; ssh without TTY; stdin from /dev/null.","solutions":["Pass --framework <name> explicitly so no selection prompt is needed.","Run in a real terminal / with a TTY (`docker exec -it`, `ssh -t`) when interactive use is intended."],"exampleFix":"// before (CI)\nhasura actions use-codegen\n// after\nhasura actions use-codegen --framework nodejs-express --output-dir src/generated","handlingStrategy":"validation","validationCode":"[ -t 0 ] || echo 'pass --framework explicitly in non-interactive shells'","typeGuard":null,"tryCatchPattern":"Catch prompt errors and re-run with an explicit --framework value.","preventionTips":["Pass --framework in all scripted invocations.","Allocate a TTY for interactive selection."],"tags":["interactive-prompt","tty","hasura-cli","ci"],"backgroundTag":"non-interactive-prompt-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}