Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dart Sass transpiler error in Hugo v0.123.0 #12072

Closed
markdumay opened this issue Feb 20, 2024 · 8 comments · Fixed by #12077
Closed

Dart Sass transpiler error in Hugo v0.123.0 #12072

markdumay opened this issue Feb 20, 2024 · 8 comments · Fixed by #12077

Comments

@markdumay
Copy link

markdumay commented Feb 20, 2024

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

hugo v0.123.0-3c8a4713908e48e6523f058ca126710397aa4ed5+extended darwin/arm64 BuildDate=2024-02-19T16:32:38Z VendorInfo=brew

Does this issue reproduce with the latest release?

Yes

Context

When upgrading Hugo from v0.122.0 to v0.123.0 I get a Dart Sass transpiler error. Below the error logs (specific to the Hinode theme):

Start building sites … 
hugo v0.123.0-3c8a4713908e48e6523f058ca126710397aa4ed5+extended darwin/arm64 BuildDate=2024-02-19T16:32:38Z VendorInfo=brew

ERROR render of "page" failed: execute of template failed: template: partials/head/head.html:8:7: executing "head" at <partialCached "head/stylesheet-core.html" .>: error calling partialCached: "/Users/mark/Development/GitHub/gethinode/hinode/layouts/partials/head/stylesheet-core.html:3:3": execute of template failed: template: partials/head/stylesheet-core.html:3:3: executing "partials/head/stylesheet-core.html" at <partial "head/stylesheet.html">: error calling partial: "/Users/mark/Development/GitHub/gethinode/hinode/layouts/partials/head/stylesheet.html:60:12": execute of template failed: template: partials/head/stylesheet.html:60:12: executing "partials/head/stylesheet.html" at <partial "head/icons.html" (dict "css" $css)>: error calling partial: "/Users/mark/Development/GitHub/gethinode/hinode/layouts/partials/head/icons.html:22:54": execute of template failed: template: partials/head/icons.html:22:54: executing "partials/head/icons.html" at <$css.Content>: error calling Content: TOCSS-DART: failed to transform "css/main.css" (text/x-scss): "/Users/mark/Development/GitHub/gethinode/hinode/_vendor/github.com/gethinode/mod-bootstrap/assets/scss/modules/bootstrap/_mixins-dart.scss:9:8": Can't find stylesheet to import.
ERROR TOCSS-DART: failed to transform "css/main.css" (text/x-scss): "/Users/mark/Development/GitHub/gethinode/hinode/_vendor/github.com/gethinode/mod-bootstrap/assets/scss/modules/bootstrap/_mixins-dart.scss:9:8": Can't find stylesheet to import.
Built in 1035 ms
Error: error building site: TOCSS-DART: failed to transform "css/main.css" (text/x-scss): "/Users/mark/Development/GitHub/gethinode/hinode/_vendor/github.com/gethinode/mod-bootstrap/assets/scss/modules/bootstrap/_mixins-dart.scss:9:8": Can't find stylesheet to import.

The full environment:

hugo v0.123.0-3c8a4713908e48e6523f058ca126710397aa4ed5+extended darwin/arm64 BuildDate=2024-02-19T16:32:38Z VendorInfo=brew
GOOS="darwin"
GOARCH="arm64"
GOVERSION="go1.22.0"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"
github.com/sass/dart-sass/protocol="2.5.0"
github.com/sass/dart-sass/compiler="1.71.0"
github.com/sass/dart-sass/implementation="1.71.0"

The error does not occur when using libsass.

To reproduce

git clone https://github.com/gethinode/hinode.git
cd hinode
hugo mod vendor
hugo server -s exampleSite

Switching to libsass in exampleSite/config/_default/params.toml solves the issue:

[main]
    [main.build]
        transpiler = "libsass"
@cmahnke
Copy link

cmahnke commented Feb 20, 2024

I had a similar error message yesterday: In my case it was caused by the fact that including a CSS file from a theme using a SCSS import as part of the site SCSS didn't resolve. I suspect that the search path of the site either doesn't include assets from the theme anymore or that this now requires a explicit mount setup.
I solved it by just copying the CSS file fro the theme to the site.

@jmooring
Copy link
Member

@markdumay

When I do this:

git clone https://github.com/gethinode/hinode.git
cd hinode
hugo mod vendor
hugo server -s exampleSite

I get this:

console log
Start building sites … 
hugo v0.123.0-e8cc785a589bb18c9336880d662a659f29bb57f3+extended linux/amd64 BuildDate=2024-02-19T17:59:28Z

ERROR render of "page" failed: execute of template failed: template: partials/head/head.html:8:7: executing "head" at <partialCached "head/stylesheet-core.html" .>: error calling partialCached: "/home/jmooring/temp/hinode/layouts/partials/head/stylesheet-core.html:3:3": execute of template failed: template: partials/head/stylesheet-core.html:3:3: executing "partials/head/stylesheet-core.html" at <partial "head/stylesheet.html">: error calling partial: "/home/jmooring/temp/hinode/layouts/partials/head/stylesheet.html:60:12": execute of template failed: template: partials/head/stylesheet.html:60:12: executing "partials/head/stylesheet.html" at <partial "head/icons.html" (dict "css" $css)>: error calling partial: "/home/jmooring/temp/hinode/layouts/partials/head/icons.html:22:54": execute of template failed: template: partials/head/icons.html:22:54: executing "partials/head/icons.html" at <$css.Content>: error calling Content: TOCSS-DART: failed to transform "css/main.css" (text/x-scss): "/home/jmooring/temp/hinode/_vendor/github.com/gethinode/mod-bootstrap/assets/scss/modules/bootstrap/_mixins-dart.scss:9:8": Can't find stylesheet to import.
ERROR render of "section" failed: execute of template failed: template: partials/head/head.html:8:7: executing "head" at <partialCached "head/stylesheet-core.html" .>: error calling partialCached: "/home/jmooring/temp/hinode/layouts/partials/head/stylesheet-core.html:3:3": execute of template failed: template: partials/head/stylesheet-core.html:3:3: executing "partials/head/stylesheet-core.html" at <partial "head/stylesheet.html">: error calling partial: "/home/jmooring/temp/hinode/layouts/partials/head/stylesheet.html:60:12": execute of template failed: template: partials/head/stylesheet.html:60:12: executing "partials/head/stylesheet.html" at <partial "head/icons.html" (dict "css" $css)>: error calling partial: "/home/jmooring/temp/hinode/layouts/partials/head/icons.html:22:54": execute of template failed: template: partials/head/icons.html:22:54: executing "partials/head/icons.html" at <$css.Content>: error calling Content: TOCSS-DART: failed to transform "css/main.css" (text/x-scss): "/home/jmooring/temp/hinode/_vendor/github.com/gethinode/mod-bootstrap/assets/scss/modules/bootstrap/_mixins-dart.scss:9:8": Can't find stylesheet to import.
ERROR TOCSS-DART: failed to transform "css/main.css" (text/x-scss): "/home/jmooring/temp/hinode/_vendor/github.com/gethinode/mod-bootstrap/assets/scss/modules/bootstrap/_mixins-dart.scss:9:8": Can't find stylesheet to import.
Built in 33402 ms
Error: error building site: TOCSS-DART: failed to transform "css/main.css" (text/x-scss): "/home/jmooring/temp/hinode/_vendor/github.com/gethinode/mod-bootstrap/assets/scss/modules/bootstrap/_mixins-dart.scss:9:8": Can't find stylesheet to import.


And main.build.transpiler is already set to libsass, so I think transpiler selection is a red herring.

@jmooring
Copy link
Member

Disregard previous comment. I changed the value in the root, not in the example site.

@cmahnke
Copy link

cmahnke commented Feb 20, 2024

@bep
Copy link
Member

bep commented Feb 20, 2024

@cmahnke to be helpful, you could provide a simple test case not link to another complex setup.

@bep
Copy link
Member

bep commented Feb 20, 2024

OK; I have found the cause of this, I just need to create a failing test for it. I will push a patch release later tonight (Norway time).

@markdumay
Copy link
Author

Great @bep, thanks a lot for your quick response!

bep added a commit to bep/hugo that referenced this issue Feb 20, 2024
bep added a commit to bep/hugo that referenced this issue Feb 20, 2024
bep added a commit that referenced this issue Feb 20, 2024
cmahnke added a commit to cmahnke/hugo-test that referenced this issue Feb 20, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants