Skip to content

Partial argument dict key mismatch silently masked by incremental rebuild cache #14923

@kobrix

Description

@kobrix

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

$ Hugo version Hugo v0.161.1

Does this issue reproduce with the latest release?

Yes.

Encountered this yesterday, and it took a while to isolate (I’m a Hugo newbie).

Description

A typo in a partial call’s argument dict (an incorrect key name) produced no error and no visible output change during a live hugo server session, despite the partial depending on that key to render content and no error was reported.

The error only surfaced as a build error after server restart, and only then because an unrelated path change triggered a hunt for why nested partials weren’t being included. Deleting public/ and rebuilding during the session didn’t clear the cached result.

Expected behaviour:

A key name mismatch between the dict passed to a partial and the keys the partial reads should throw a build error or warning of some sort.

Actual behaviour:

Hugo continued serving the previously-cached (correct) output for the partial, entirely masking the error. The session ran across approx 30 commits without any indication that the partial was not being re-evaluated.

Steps to reproduce:

  1. Start hugo server with a working partial at layouts/_partials/exhibitions-current.html, called from home.html as partial "exhibitions-current.html"
  2. While server running, move partial to layouts/_partials/base/exhibitions-current.html without updating the call in home.html
  3. Hugo continues serving the correct output despite the partial now being unreachable at the original path
  4. In the same session, introduce a key name mismatch in the dict passed to a nested component partial, e.g. pass "exhibitionss" where the component reads .exhibitions
  5. Hugo carries on serving the correct output without giving an error or warning
  6. Restart the server. Hugo now errors on the broken path from step 2. Once this is corrected, the key mismatch from step 4 silently produces empty output.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions