Skip to content

Error 'render of "page" failed' does not mention content file #14607

@cweiske

Description

@cweiske

When upgrading to a new Hugo version, I get an error during build:

render: failed to render pages: render of "page" failed: "/data/hugo-base/layouts/plugins/single.html:35:77": execute of template failed: template: plugins/single.html:35:77: executing "main" at <(index $.Site.Taxonomies.capabilities (anchorize .)).Page>: error calling Page: WeightedPages is empty

The problem is caused by a content file, but Hugo does not tell me which one. This really hinders debugging when you have 300+ content pages.

Please mention the name of the content file that is being processed.

(This is a split off from #12693 (comment))

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.131.0+extended linux/amd64 BuildDate=2024-09-03T01:15:37Z VendorInfo=debian:0.131.0-1

Does this issue reproduce with the latest release?

Yes.
Error message source code location is

return fmt.Errorf("render of %q failed: %w", filename, err)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions