Dart-sass-embedded path quandary

Briefly:
Attempting to compile Sass with dart-sass-embedded yields “You need dart-sass-embedded in your system $PATH” no matter what I do.

This issue potentially duplicates Installing dart-sass-embedded and How to use dart sass?. I have reviewed both of those items in some detail, but haven’t been able to arrive at a solution.

Here’s some console matter:

$ echo $PATH
(returns lots of stuff, but including this entry)

[snip]:~/.local/bin/sass_embedded-beta7:[snip]

$ which dart-sass-embedded

~/.local/bin/sass_embedded-beta7/dart-sass-embedded

$ hugo

Start building sites …
hugo v0.84.2+extended linux/amd64 BuildDate=2021-06-28T15:14:06Z
Total in 59 ms
Error: Error building site: TOCSS-DART: failed to transform “scss/main.scss” (text/x-scss). You need dart-sass-embedded in your system $PATH.

Any insight on this matter would be most gratefully received.

“Who” is running hugo? Your user or some other user? Maybe add a script that runs echo $PATH and then executes hugo, so that you see what exactly is in Hugo’s user’s path. Your issue points to the program NOT being in Hugo’s system path.

I am running Hugo too with dart-sass, but I install the Dart SDK (via snap) and then no additional issues come up. I also don’t have a dart-sass-embedded in my environment. Maybe go that route?

Interesting! Thank you for the quick reply.

I don’t see the Dart SDK on snapcraft, so wondering where/how you found it as a snap. I did install the Dart SDK via the regular .deb package. That unfortunately didn’t change anything, and the same error is being returned.

I also wrote a little shell script along the lines of:

echo $PATH
which dart-sass-embedded
hugo

As I expected, it returns the same output as when I execute the same commands manually.

I do agree that there is some confusion around which user hugo is running under, but given that I’m executing it myself, I would assume that it is running as me, with all the same $PATH juice as any other command gets when I run it.

And so back to square one.
¯\_(ツ)_/¯

How did you install Hugo?

1 Like

AHA

I did snap install hugo --channel=extended

I have just removed the snap and reinstalled hugo with the deb package from Github. Dartsass is now working.

Thank you for asking the right question. Solved!

cc: @anthonyfok

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