{"record":{"id":"70d2ee880a2b2ceb","repo":"gohugoio/hugo","slug":"resource-t-does-not-support-resource-source","errorCode":null,"errorMessage":"resource %T does not support resource.Source","messagePattern":"resource %T does not support resource\\.Source","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/page.go","lineNumber":739,"sourceCode":"}\n\nfunc (ps *pageState) renderResources() error {\n\tfor _, r := range ps.Resources() {\n\t\tif _, ok := r.(page.Page); ok {\n\t\t\tif !ps.s.h.BuildState.IsRebuild() {\n\t\t\t\t// Pages gets rendered with the owning page but we count them here.\n\t\t\t\tps.s.PathSpec.ProcessingStats.Incr(&ps.s.PathSpec.ProcessingStats.Pages)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif resources.IsPublished(r) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsrc, ok := r.(resource.Source)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"resource %T does not support resource.Source\", r)\n\t\t}\n\n\t\tif err := src.Publish(); err != nil {\n\t\t\tif !herrors.IsNotExist(err) {\n\t\t\t\tps.s.Log.Errorf(\"Failed to publish Resource for page %q: %s\", ps.pathOrTitle(), err)\n\t\t\t}\n\t\t} else {\n\t\t\tps.s.PathSpec.ProcessingStats.Incr(&ps.s.PathSpec.ProcessingStats.Files)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (ps *pageState) AlternativeOutputFormats() page.OutputFormats {\n\tf := ps.outputFormat()\n\tvar o page.OutputFormats\n\tfor _, of := range ps.OutputFormats() {","sourceCodeStart":721,"sourceCodeEnd":757,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/page.go#L721-L757","documentation":"Emitted from pageState.renderResources (page.go:739). When publishing a page's non-Page resources, Hugo type-asserts each resource to resource.Source (the interface providing Publish()). If a resource does not satisfy that interface, the build aborts — a resource was attached to a page that has no notion of being published to the output filesystem.","triggerScenarios":"A custom resource type, or a constructed resource object that implements resource.Resource but not resource.Source, is present in a page's Resources() collection at publish time. Typically a programming/integration bug rather than an authoring mistake.","commonSituations":"Embedding Hugo as a library and injecting a custom resource; a resource adapter returning an incomplete type; a stale/incompatible Hugo module that wraps resources incorrectly.","solutions":["Inspect the %T in the message to learn which concrete resource type is missing Publish().","Ensure any custom resource type implements resource.Source (Publish() error) in addition to resource.Resource.","Update the Hugo module/wrapper that produced the resource to a compatible version."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// for Go integrations injecting resources: ensure they satisfy resource.Source\nfunc isPublishable(r resource.Resource) bool {\n    _, ok := r.(resource.Source) // requires Publish() error\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Custom resource types must implement resource.Source (Publish) for page bundles.","Don't wrap/stripped resources in adapters that drop the Publish method.","Inspect the %T in the message to find the offending type."],"tags":["resources","publish","interface","page-bundle"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}