Scss changes do not reload live

hello I changed all my css files to scss and now my live reload no longer works.
I have a partial called css.html

{{- /* Styles */}}

{{ $theme_vars :=slice (resources.Get "/scss/core/theme-vars.scss") }}
{{ $reset :=slice (resources.Get "/scss/core/reset.scss") }}
{{ $common := (resources.Match "/scss/common/*.scss") }}

{{- /* markup.highlight.noClasses should be set to `false` */}}
{{ $code_styles :=slice (resources.Get "/scss/includes/syntax-light.scss") }}

{{ $extended := (resources.Match "/scss/extended/*.scss") }}

{{- /* order is important */}}
{{ $styles := (slice $theme_vars $reset $common $code_styles $extended) }}

{{- /* bundle all required css */}}
{{- /* Add extended css after theme style */ -}}

{{- /* scss compile optionss */}}

{{ if eq hugo.Environment "development" }}
  {{ $stylesheets := slice }}
  {{ range $styles }}

    {{ $stylesheets = $stylesheets | collections.Append . }}

  {{ end }}

  {{ range $stylesheets }}
    {{ $opts := dict "transpiler" "dartsass" }}
    {{ $scsss := . | fingerprint | resources.ToCSS $opts }}
    <link
      crossorigin="anonymous"
      href="{{ $scsss.RelPermalink }}"
      rel="preload stylesheet"
      as="style"
    />
  {{ end }}
{{ else }}
  {{ $stylesheets := slice }}

  {{ range $sty := $styles }}
    {{ $stylesheets = $stylesheets | collections.Append $sty }}
  {{ end }}
  {{ $opts := dict "transpiler" "dartsass" }}

  {{ $stylesheet := $stylesheets | resources.Concat "assets/scss/stylesheet.scss"| resources.ToCSS $opts | resources.Minify | fingerprint }}
  <link
    crossorigin="anonymous"
    href="{{ $stylesheet.RelPermalink }}"
    integrity="{{ $stylesheet.Data.Integrity }}"
    rel="preload stylesheet"
    as="style"
  />
{{ end }}

and the folter /scss/common/ contans 6 more scss files. If I change one of those files the server notices it and reloads, but the file stays the same. even when fingerprinting. Only a restart of hugo will refresh those files.
The command hugo serve --noHTTPCache --ignoreCache --disableFastRender -v --cleanDestinationDir --renderToMemory does not help

it seems the toCSS function does not like it to be called in a slice.

related topics

thank you

Version?

from the hugo env command
hugo v0.125.1-68c5ad638c2072969e47262926b912e80fd71a77+extended windows/amd64 BuildDate=2024-04-18T08:21:19Z VendorInfo=gohugoio
GOOS=“windows”
GOARCH=“amd64”
GOVERSION=“go1.22.2”
github.com/sass/libsass=“3.6.5”
github.com/webmproject/libwebp=“v1.3.2”
github.com/sass/dart-sass/protocol=“2.7.0”
github.com/sass/dart-sass/compiler=“1.76.0”
github.com/sass/dart-sass/implementation=“1.76.0”

This works as expected in v0.122.0, but fails with v0.123.0 and later.

Minimal reproducible example:

git clone --single-branch -b hugo-forum-topic-49591 https://github.com/jmooring/hugo-testing hugo-forum-topic-49591
cd hugo-forum-topic-49591
hugo server

Browse to http://localhost:1313/, then make changes to assets/dir/b.scss.

Results:

  • Expected: home page shows changes.
  • Actual: no change.

Note that changes to assets/a.scss are shown immediately.

See https://github.com/gohugoio/hugo/issues/12456.

In the interest of tracking forum topics related to v0.123.x that do not have a corresponding GitHub issue, I am marking this resolved.


Edit: this was fixed in v0.125.6.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.