{"record":{"id":"4ed1f9802841c484","repo":"gohugoio/hugo","slug":"failed-to-create-config-w","errorCode":null,"errorMessage":"failed to create config: %w","messagePattern":"failed to create config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/allconfig/load.go","lineNumber":93,"sourceCode":"\n\tmoduleConfig, modulesClient, err := l.loadModules(configs, d.IgnoreModuleDoesNotExist)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to load modules: %w\", err)\n\t}\n\n\tif len(l.ModulesConfigFiles) > 0 {\n\t\t// Config merged in from modules.\n\t\t// Re-read the config.\n\t\tconfigs, err = fromLoadConfigResult(d.Fs, d.Logger, res)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create config from modules config: %w\", err)\n\t\t}\n\t\tif err := configs.transientErr(); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create config from modules config: %w\", err)\n\t\t}\n\t\tconfigs.LoadingInfo.ConfigFiles = append(configs.LoadingInfo.ConfigFiles, l.ModulesConfigFiles...)\n\t} else if err := configs.transientErr(); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create config: %w\", err)\n\t}\n\n\tconfigs.Modules = moduleConfig.AllModules\n\tconfigs.ModulesClient = modulesClient\n\n\tif !d.SkipNpmCheck && npm.NpmPackNeedsUpdate(d.Fs, configs.Modules) {\n\t\td.Logger.Warnln(`npm dependencies are out of sync, please run \"hugo mod npm pack\" (you may also want to run \"npm install\" after that)`)\n\t}\n\n\tif err := configs.Init(d.Fs, d.Logger); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to init config: %w\", err)\n\t}\n\n\tloggers.SetGlobalLogger(d.Logger)\n\n\treturn\n}\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/config/allconfig/load.go#L75-L111","documentation":"The non-module branch: when no module config files were merged, LoadConfig still calls configs.transientErr() as a safety check. If any per-language Config carries a transient error from the first decode pass, it is wrapped and returned here. Functionally the no-modules twin of error 270.","triggerScenarios":"A single-language or no-theme project where the first decode pass tolerated a deferred error that transientErr now escalates.","commonSituations":"Edge-case config that decodes but is internally inconsistent; rarely hit in practice because most issues fail decode outright (error 267).","solutions":["Read the wrapped transient error for the specific language and cause.","Fix the named field; if the message is opaque, simplify config and bisect."],"exampleFix":"// resolve the named per-language field per the wrapped error message\n// no generic before/after applies","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if _, err := allconfig.LoadConfig(d); err != nil {\n    // message: failed to create config: <transient>\n    return err\n}","preventionTips":["Simplify to a single language to confirm the transient error clears.","Re-introduce complexity gradually."],"tags":["config","languages","internal"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}