{"record":{"id":"f559b9d373cd4280","repo":"gohugoio/hugo","slug":"partial-q-not-found","errorCode":null,"errorMessage":"partial %q not found","messagePattern":"partial %q not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tpl/partials/partials.go","lineNumber":140,"sourceCode":"}\n\nfunc (ns *Namespace) include(ctx context.Context, name string, dataList ...any) includeResult {\n\tv, err := ns.lookup(name)\n\tif err != nil {\n\t\treturn includeResult{err: err}\n\t}\n\treturn ns.doInclude(ctx, \"\", v, dataList...)\n}\n\nfunc (ns *Namespace) lookup(name string) (*tplimpl.TemplInfo, error) {\n\tif strings.HasPrefix(name, \"partials/\") {\n\t\t// This is most likely not what the user intended.\n\t\t// This worked before Hugo 0.146.0.\n\t\tns.deps.Log.Warnidf(constants.WarnPartialSuperfluousPrefix, \"Doubtful use of partial function in {{ partial \\\"%s\\\"}}), this is most likely not what you want. Consider removing superfluous prefix \\\"partials/\\\" from template name given as first function argument.\", name)\n\t}\n\tv := ns.deps.TemplateStore.LookupPartial(name)\n\tif v == nil {\n\t\treturn nil, fmt.Errorf(\"partial %q not found\", name)\n\t}\n\treturn v, nil\n}\n\n// include is a helper function that lookups and executes the named partial.\n// Returns the final template name and the rendered output.\nfunc (ns *Namespace) doInclude(ctx context.Context, key string, templ *tplimpl.TemplInfo, dataList ...any) includeResult {\n\tif templ.ParseInfo.HasPartialInner {\n\t\tstack := tpl.Context.PartialDecoratorIDStack.Get(ctx)\n\t\tif stack != nil {\n\t\t\tif id, ok := stack.Peek(); ok {\n\t\t\t\t// Signal that inner exists.\n\t\t\t\tid.Bool = true\n\t\t\t}\n\t\t}\n\t}\n\tvar data any\n\tif len(dataList) > 0 {","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/tpl/partials/partials.go#L122-L158","documentation":"Thrown by partials.lookup when TemplateStore.LookupPartial returns nil for the given name. Since Hugo 0.146.0 the partials/ prefix is stripped automatically; including it only triggers a warning, but a truly unknown name raises this error.","triggerScenarios":"Calling {{ partial \"my/partial\" . }} or {{ partialCached \"my/partial\" . }} where no template exists at layouts/partials/my/partial.html (or .tpl, or under _partials/).","commonSituations":"Typo in the partial name, missing .html file extension in the filename, partial file placed outside layouts/partials/, case mismatch on case-sensitive filesystems, or referencing a partial from a theme that isn't installed/configured. Common after renaming or moving partial files.","solutions":["Verify the file exists at layouts/partials/<name>.html (do not include the 'partials/' prefix in the call).","Check for typos and case sensitivity in the partial name.","Run hugo with --templateMetrics to list resolved/missing templates.","If using a theme, confirm the theme is set in config and the partial ships with it."],"exampleFix":"// before (missing file, typo):\n{{ partial \"headder.html\" . }}\n// after:\n{{ partial \"header.html\" . }}","handlingStrategy":"validation","validationCode":"{{ if templates.Exists \"partials/my/partial.html\" }}\n  {{ partial \"my/partial\" . }}\n{{ else }}\n  {{ warnf \"partial not found\" }}\n{{ end }}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use templates.Exists to check before invoking a partial you are unsure about.","Do not include the 'partials/' prefix in the call (Hugo 0.146+).","Keep partial names in a central list/variable to avoid typos."],"tags":["partials","template","lookup","template-not-found"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}