Skip to content

_index.md + HTML file w/o front matter causes hugo serve to hang during re-render #7028

Closed
@benkuhn

Description

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

$ hugo version
Hugo Static Site Generator v0.66.0/extended darwin/amd64 BuildDate: unknown

Does this issue reproduce with the latest release?

Yes

Steps to reproduce:

Note that I haven't found a minimal repro and the site that I know reproduces this is private.

If it's not easy to diagnose the error from the stack traces I've attached below, I'm happy to try to minimize the reproduction, but I suspect it's something about my custom theme and am not looking forward to trying to minimize it--so I'm posting here first in case the stack traces make it obvious.

Steps:

  1. Use the following content hierarchy:
# content/posts/drafts/_index.md
---
cascade:
    draft: true
---
# content/posts/drafts/conviction.md
---
title: ...
---

...
  1. hugo serve --buildDrafts
  2. Navigate to /conviction/, the URL of a draft post
  3. Edit the draft post by inserting a paragraph containing "asdf" at the beginning
  4. Observe that the browser does not auto-reload
  5. Observe that the server never the log line Source changed "/Users/ben/code/benkuhn.net/content/posts/drafts/conviction.md": WRITE, but not the next expected line Total in <X> ms
  6. Try to navigate to another page (that hasn't been rendered yet)
  7. Observe an infinite loading spinner

The problem does not reproduce if I remove the drafts/_index.md file and add draft: true to conviction.md. It also does not reproduce when I edit a non-draft. It does reproduce with --disableFastRender or --disableLiveReload.

I ran the first step with GOTRACEBACK=all and sent SIGQUIT to the server while it was hung; it produced the following stacktraces:

stacktrace.txt

I also ran it with --trace and it produced the following file (gzipped so github will let me upload):
hugo-trace.gz

As I mentioned, I couldn't reproduce this with a blank site, so there must be some other part of my config that's interacting with the cascade: {draft: true} setting. Please let me know if you have ideas for what that could be, as it'll help me create a minimal repro.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions