{"record":{"id":"8f25788ea92c4bf6","repo":"grafana/k6","slug":"failed-to-get-version-details-with-extensions-w","errorCode":null,"errorMessage":"failed to get version details with extensions: %w","messagePattern":"failed to get version details with extensions: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/version.go","lineNumber":229,"sourceCode":"\treturn details, nil\n}\n\ntype versionCmd struct {\n\tgs     *state.GlobalState\n\tisJSON bool\n}\n\nfunc (c *versionCmd) run(cmd *cobra.Command, _ []string) error {\n\tif !c.isJSON {\n\t\troot := cmd.Root()\n\t\troot.SetArgs([]string{\"--version\"})\n\t\t_ = root.Execute()\n\t\treturn nil\n\t}\n\n\tdetails, err := versionDetailsWithExtensions(ext.GetAll())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get version details with extensions: %w\", err)\n\t}\n\n\tif err := json.NewEncoder(c.gs.Stdout).Encode(details); err != nil {\n\t\treturn fmt.Errorf(\"failed to encode/output version details: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc getCmdVersion(gs *state.GlobalState) *cobra.Command {\n\tversionCmd := &versionCmd{gs: gs}\n\n\tcmd := &cobra.Command{\n\t\tUse:    \"version\",\n\t\tShort:  \"Show application version\",\n\t\tLong:   `Show the application version and exit.`,\n\t\tHidden: true,\n\t\tRunE:   versionCmd.run,","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/cmd/version.go#L211-L247","documentation":"Generic wrapper in versionCmd.run around versionDetailsWithExtensions; the real cause is typically the 'unhandled extension type' guard firing while collecting extension metadata for 'k6 version --json'.","triggerScenarios":"Thrown at internal/cmd/version.go:229 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Look at the wrapped error — for unhandled extension type, upgrade k6 or rebuild the xk6 binary with compatible extensions","Run plain 'k6 version' (non-JSON) which does not enumerate extensions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}