I’m not using a netlify.toml - I am however setting the HUGO_VERSION in the env vars to 0.42. Interestingly the same error occurred when I went up to 0.49.2 - its really random. Kind of good to know I’m the only one… I’m thinking its something other than hugo doing this. I’ll keep digging.
The above is by definition a bug in Hugo (or somewhere in Go). But it can be hard to identify/fix. As I have not seen this in a live site for years, and you say this happens with the latest Hugo, I suspect you must do “something special”. But it’s still a bug.
Can you post the full stack trace? I.e. is it more after “10:14:04 AM: reflect.mapiternext(0xc420d6d860)”?
I did post a PR for this issue within nhs-service-finder hugo site. The problem was writing in the same key of a specific Scratch instance within loop of Pages. And the solution was to use a different name for each Page.
This issue may not be resolved with this change. Though i didn’t see it after the change.