Hi!
Problem Description: When attempting to run a Hugo project on my macOS device using the hugo
command, the following error occurs:
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.
==> /opt/homebrew/opt/dart/libexec/bin/dart compile exe -Dversion=1.70.0 -Dcompiler-version=1.70.0 -Dprotocol-version=2.5.0 bin/sass.dart -o sass
lib/src/embedded/compilation_dispatcher.dart:213:22: Error: The type ‘InboundMessage_CompileRequest_Importer_Importer’ is not exhaustively matched by the switch cases since it doesn’t match ‘InboundMessage_CompileRequest_Importer_Importer.nodePackageImporter’.
- ‘InboundMessage_CompileRequest_Importer_Importer’ is from ‘package:sass/src/embedded/embedded_sass.pb.dart’ (‘lib/src/embedded/embedded_sass.pb.dart’).
Try adding a default case or cases that match ‘InboundMessage_CompileRequest_Importer_Importer.nodePackageImporter’.
switch (importer.whichImporter()) {
^
Error: AOT compilation failed
Generating AOT kernel dill failed!
Additionally, attempting to install Node Sass using the brew install node-sass
command also did not help resolve the issue.
Additional Information:
- Version of Sass installed via npm: 1.70.0
- Hugo version: v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended darwin/arm64 BuildDate=2024-01-26T15:54:24Z VendorInfo=brew
- Operating system: macOS
- Output of
sass --version
command: 1.70.0 compiled with dart2js 3.2.5 - Output of
sass --embedded --version
command: sass --embedded is unavailable in pure JS mode. - Attempted to install Sass via npm, but the problem was not resolved.
- Tried specifying the path to the Sass executable file in the Hugo configuration file, but this also
❯ hugo env
hugo v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended darwin/arm64 BuildDate=2024-01-26T15:54:24Z VendorInfo=brew
GOOS=“darwin”
GOARCH=“arm64”
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”