I’m new to Hugo and looking to develop a site from scratch (not using a prebuilt theme) to learn the ins and outs of Hugo. However, I’ve already hit a hurdle. I read that Hugo is using libsass but of course this is now outdated so was looking to set up dartsass going forward. I’ve added a sass folder with main.scss to the assets folder. The following code has been added to my head
Running Hugo server produced the following error:
Error: error building site: 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’ve checked my permissions -rwxr-xr-x 1 xxxxx staff 418 Oct 26 1985 …/lib/node_modules/sass/sass.js and there correct it seems.
Any help would be appreciated, really want to get going with Hugo but this is currently putting me off.
hugo v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended darwin/amd64 BuildDate=2024-01-26T15:54:24Z VendorInfo=brew
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.21.6"
sass --embedded is unavailable in pure JS mode.
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2
You could try re-installing Dart Sass and check again with Hugo. Should be a minor integration issue. Hugo should be able to show Dart Sass as an active transpiler when running hugo env
When Hugo transpiles Sass to CSS it “shells out” to Dart Sass using the Embedded Sass Protocol via the --embedded CLI flag for the Dart Sass executable.
The Node.js Dart Sass implementation specifically excludes this capability, which is why this installation method is not listed in the Hugo documentation referenced above.