➜ hugo new blog/2025/ananke-the-long-road --logLevel debug
Error: html/template::1:45: {{range}} branches end in different contexts: {stateJS delimNone urlPartNone jsCtxDivOp attrNone elementScript <nil>}, {stateText delimNone urlPartNone jsCtxRegexp attrNone elementNone <nil>}
In GoHugo v0.145.0:
➜ hugo new blog/2025/ananke-the-long-road
Content dir "/home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2025/ananke-the-long-road" created
Is that a layout error? The 1:45 would point there, but It does not name a file.
In what circumstances would the “range branches end in different contexts” appear? I am not sure I get the meaning of the error.
git clone --recurse-submodules https://github.com/davidsneighbour/kollitsch.dev
cd kollitsch.dev/
npm i
The npm i command emitted many warnings and errors.
log
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: eslint-config-standard@17.1.0
npm warn Found: eslint@9.22.0
npm warn node_modules/@davidsneighbour/eslint-config/node_modules/eslint
npm warn eslint@"9.22.0" from @davidsneighbour/eslint-config@2025.1.1
npm warn node_modules/@davidsneighbour/eslint-config
npm warn @davidsneighbour/eslint-config@"2025.1.1" from the root project
npm warn
npm warn Could not resolve dependency:
npm warn peer eslint@"^8.0.1" from eslint-config-standard@17.1.0
npm warn node_modules/@davidsneighbour/eslint-config/node_modules/eslint-config-standard
npm warn eslint-config-standard@"17.1.0" from @davidsneighbour/eslint-config@2025.1.1
npm warn node_modules/@davidsneighbour/eslint-config
npm warn
npm warn Conflicting peer dependency: eslint@8.57.1
npm warn node_modules/eslint
npm warn peer eslint@"^8.0.1" from eslint-config-standard@17.1.0
npm warn node_modules/@davidsneighbour/eslint-config/node_modules/eslint-config-standard
npm warn eslint-config-standard@"17.1.0" from @davidsneighbour/eslint-config@2025.1.1
npm warn node_modules/@davidsneighbour/eslint-config
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '@davidsneighbour/kollitsch-dev@2025.1.1',
npm warn EBADENGINE required: { node: '>=23.6.1', npm: '>=11.1.0' },
npm warn EBADENGINE current: { node: 'v22.14.0', npm: '11.0.0' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '@davidsneighbour/stylelint-config@2025.1.1',
npm warn EBADENGINE required: { node: '>=22.14.0', npm: '>=11.1.0' },
npm warn EBADENGINE current: { node: 'v22.14.0', npm: '11.0.0' }
npm warn EBADENGINE }
npm warn deprecated try-resolve@1.0.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated npmlog@5.0.1: This package is no longer supported.
npm warn deprecated trim@1.0.1: Use String.prototype.trim() instead
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm warn deprecated consolidate@0.15.1: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated @material/mwc-icon@0.25.3: MWC beta is longer supported. Please upgrade to @material/web
npm warn deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
npm warn deprecated
npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
npm warn deprecated gauge@3.0.2: This package is no longer supported.
npm warn deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.
npm warn deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm error code 7
npm error path /home/jmooring/temp/kollitsch.dev/node_modules/netlify-cli/node_modules/sharp
npm error command failed
npm error command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm error A complete log of this run can be found in: /home/jmooring/.npm/_logs/2025-04-11T01_34_33_377Z-debug-0.log
Then I tried to build with v0.145.0 and got many errors like this:
Error: error building site: process: readAndProcessContent: “/home/jmooring/temp/kollitsch.dev/content/keycombinations.md:27:1”: failed to extract shortcode: template for shortcode “keycombinations” not found
What do I need to do to successfully build this site with v0.145.0?
Probably run hugo mod tidy. That’s what I meant by “module mess”.
I got this error fixed now. The reason was that somehow Golang now parses partials that are within other code structures, even if the whole block is commented out. Basically, {{/* something {{ range something }} something else */}} resulted in the inner range being parsed. Having that in a <script> tag will lead to the elementScript/elementNone combination, specifically in my error from above. Also, the {{- minus seems to have been a factor.
The html/template::1:45: was Golangs way of telling me to stop commenting-out code parts I am testing by wasting my weekend.
This seems to be an issue in Golang and it’s template engine, not GoHugo, and thus the {{range}} branches end in different contexts saga ends. Now onto missing layout files
I’m not sure what was wrong, but I want to make sure that anyone else stumbling across this doesn’t think that there is a problem with template comments.