{"id":"5c1fd7475d57b2da","repo":"gohugoio/hugo","slug":"unknown-output-format-q-for-kind-q","errorCode":null,"errorMessage":"unknown output format %q for kind %q","messagePattern":"unknown output format %q for kind %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/allconfig/allconfig.go","lineNumber":317,"sourceCode":"\t\tif newKind := kinds.IsDeprecatedAndReplacedWith(kind); newKind != \"\" {\n\t\t\tlogger.Deprecatef(false, \"Kind %q used in outputs configuration is deprecated, use %q instead.\", kind, newKind)\n\t\t\tkind = newKind\n\t\t}\n\t\tif disabledKinds[kind] {\n\t\t\tcontinue\n\t\t}\n\t\tif kinds.GetKindAny(kind) == \"\" {\n\t\t\tlogger.Warnf(\"Unknown kind %q in outputs configuration.\", kind)\n\t\t\tcontinue\n\t\t}\n\t\tfor _, format := range formats {\n\t\t\tif isRssDisabled && format == \"rss\" {\n\t\t\t\t// Legacy config.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tf, found := outputFormats.GetByName(format)\n\t\t\tif !found {\n\t\t\t\ttransientErr = fmt.Errorf(\"unknown output format %q for kind %q\", format, kind)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tkindOutputFormats[kind] = append(kindOutputFormats[kind], f)\n\t\t}\n\t}\n\n\tdefaultOutputFormat := outputFormats[0]\n\tc.DefaultOutputFormat = strings.ToLower(c.DefaultOutputFormat)\n\tif c.DefaultOutputFormat != \"\" {\n\t\tf, found := outputFormats.GetByName(c.DefaultOutputFormat)\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"unknown default output format %q\", c.DefaultOutputFormat)\n\t\t}\n\t\tdefaultOutputFormat = f\n\t} else {\n\t\tc.DefaultOutputFormat = defaultOutputFormat.Name\n\t}\n","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/config/allconfig/allconfig.go#L299-L335","documentation":"In the `outputs` config map, each page kind (home, section, page, taxonomy, term) lists output format names that must exist in Hugo's built-in or custom `outputFormats` definitions. If `outputFormats.GetByName` misses, Hugo records this as a transient error, which later fails the load with a \"failed to create config\" wrapper.","triggerScenarios":"An entry like `[outputs] home = [\"HTML\", \"JSONN\"]` naming a format not defined in `[outputFormats]`; defining a custom format in one config file but referencing it in another that loads without it (e.g. per-language or module config).","commonSituations":"Typos in format names, referencing a custom output format (e.g. \"SearchIndex\") before/without defining it under `[outputFormats]`, or a theme expecting a format the site config removed.","solutions":["Fix the spelling — format lookup matches defined names like HTML, RSS, JSON, AMP (case-insensitive).","Define the custom format under `[outputFormats.<Name>]` with `mediaType`, `baseName`, etc., before referencing it in `outputs`.","Run `hugo config` to see which output formats are actually defined after merging site + theme + module configs."],"exampleFix":"# before\n[outputs]\nhome = [\"HTML\", \"SearchIndex\"]\n# after\n[outputFormats.SearchIndex]\nmediaType = \"application/json\"\nbaseName = \"searchindex\"\n[outputs]\nhome = [\"HTML\", \"SearchIndex\"]","handlingStrategy":"validation","validationCode":"valid := map[string]bool{}\nfor _, f := range output.DefaultFormats {\n    valid[strings.ToLower(f.Name)] = true\n}\nfor kind, formats := range outputsConfig {\n    for _, name := range formats {\n        if !valid[strings.ToLower(name)] {\n            return fmt.Errorf(\"outputs.%s references unknown format %q\", kind, name)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Define custom formats under [outputFormats] before referencing them in [outputs]","Match names case-insensitively but spell them consistently (e.g. \"html\", \"rss\", \"json\")","Check for typos when copying outputs config between projects"],"tags":["hugo","config","output-formats"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}