Hi!
As in so many other posts, when running the SASS compilation HUGO fails with the following message:
ERROR Failed to render "/": TOCSS-DART: failed to transform "/sass/main.scss" (text/x-scss): got unexpected EOF when executing "sass". The user running hugo must have read and execute permissions on this program. With execute permissions only, this error is thrown.
I found quite useful this thread https://discourse.gohugo.io/t/error-building-site-tocss-dart/48047 as the output from the different suggested command are different, but I’m not succeeding in finding how to fix the problem.
Just for context, I’m on a macOS, and I’ve installed the Dart-Sass command as suggested in the Hugo Documentation so with the command brew install sass/sass/sass
.
I guess the below means the dart-sass lib is not recognized by hugo
· hugo env
hugo v0.135.0+extended darwin/arm64 BuildDate=2024-09-27T13:17:08Z VendorInfo=brew
GOOS="darwin"
GOARCH="arm64"
GOVERSION="go1.23.1"
OptionParser::InvalidOption: invalid option: --embedded
Use --trace for backtrace.
github.com/sass/libsass="3.6.6"
github.com/webmproject/libwebp="v1.3.2"
Below is the sass command which is not even recognizing the flags, and it returns the Ruby Sass library
· sass --embedded --version
OptionParser::InvalidOption: invalid option: --embedded
Use --trace for backtrace.
· sass -v
Ruby Sass 3.7.4
After looking for other ‘sass’ libraries in the system I found the dart-sass placed in a different folder /opt/homebrew/Cellar/sass/1.79.5/bin/sass
, and running the same --embedded --version
command I got the expected output:
· /opt/homebrew/Cellar/sass/1.79.5/bin/sass --embedded --version
{
"protocolVersion": "3.1.0",
"compilerVersion": "1.79.5",
"implementationVersion": "1.79.5",
"implementationName": "dart-sass",
"id": 0
}
So, how can I set hugo to use that /opt/homebrew/Cellar/sass/1.79.5/bin/sass
library?