-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Differentiate error messages between "PostCSS not found" and "libSass not compiled in" #5111
Comments
Just to clarify: what I meant is that I got confused myself, recalling that the PostCSS feature is not tied to the "extended" Hugo version, and I had to This is actually documented at https://gohugo.io/hugo-pipes/postcss/, though the actual |
I suggest you make this simple. If you locate the place this error is logged, you can just check the variable where "POSTCSS" is fetched -- you can consider that value to be stable. |
Thank you for your great advice! I have made a PR in #5114. Meanwhile, I have also expanded a little bit on https://gohugo.io/hugo-pipes/postcss/ in gohugoio/hugoDocs@64b9ecc. |
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. |
As of 0.47.1, according to Transform() in resource/postcss/postcss.go, when Hugo cannot find the executable "postcss" in "node_modules/postcss-cli/bin/" (fetched via
npm install postcss-cli
without the-g
flag) or in the PATH, it would show errors.FeatureNotAvailableErr, i.e.:resulting in, for example:
which is slightly misleading for the end user because the correct solution is not to look for another Hugo version (extended or not), but to have PostCSS (postcss-cli) installed properly so that Hugo can find it.
I hesitate to change the error message directly because errors.FeatureNotAvailableErr is also used, accurately, when libSass is not compiled in. I thought of creating another error message altogether, but hesitated when I realized that in resource/transform.go errors.FeatureNotAvailableErr is used as a check.
So, yes, I thought I should ask you (bep) first how to best approach this issue. :-)
Admittedly, a very minor issue, and non-urgent. Thanks in advance for looking into this!
P.S. I came across this when I finally tested my recent changes to snapcraft.yaml going into 0.47.1, and discovered that my fix didn't work. (Oops, sorry!) First of all, I inadvertently deleted the "usr/bin/nodejs" binary in the clean-up, and secondly, it was a rather old v4 version that got installed as "usr/bin/nodejs" instead of "usr/bin/node". A fix for that will be ready soon, by using the "nodejs" plugin in Snap.
The text was updated successfully, but these errors were encountered: