gohugoio/hugo · error · FeatureNotAvailableError

this feature is not available in your current Hugo version,

Error message

this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information

What it means

ErrFeatureNotAvailable is a sentinel FeatureNotAvailableError used for optional Hugo features compiled out of the binary (e.g. libsass-based SCSS). When a template or resource path invokes such a feature in a binary that was not built with it, this error is returned.

Source

Thrown at common/herrors/errors.go:87

func (e *errMessage) Error() string {
	return e.msg
}

func (e *errMessage) Unwrap() error {
	return e.err
}

// IsFeatureNotAvailableError returns true if the given error is or contains a FeatureNotAvailableError.
func IsFeatureNotAvailableError(err error) bool {
	return errors.Is(err, &FeatureNotAvailableError{})
}

// ErrFeatureNotAvailable denotes that a feature is unavailable.
//
// We will, at least to begin with, make some Hugo features (SCSS with libsass) optional,
// and this error is used to signal those situations.
var ErrFeatureNotAvailable = &FeatureNotAvailableError{Cause: errors.New("this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information")}

// FeatureNotAvailableError is an error type used to signal that a feature is not available.
type FeatureNotAvailableError struct {
	Cause error
}

func (e *FeatureNotAvailableError) Unwrap() error {
	return e.Cause
}

func (e *FeatureNotAvailableError) Error() string {
	return e.Cause.Error()
}

func (e *FeatureNotAvailableError) Is(target error) bool {
	_, ok := target.(*FeatureNotAvailableError)
	return ok
}

View on GitHub (pinned to 52c9bd7908)

Solutions

  1. Install the Hugo extended build (or the build that includes the needed feature)
  2. Switch to the supported alternative (e.g. Dart Sass transpiler options)
  3. Build Hugo from source with the required build tag

Example fix

# before
hugo  # missing libsass
# after (install hugo extended)
# download hugo_extended_<version>.tar.gz and retry
Defensive patterns

Strategy: try-catch

Type guard

func isFeatureNotAvailable(err error) bool {
    return herrors.IsFeatureNotAvailableError(err)
}

Try / catch

if _, err := feature.Call(...); err != nil {
    if herrors.IsFeatureNotAvailableError(err) {
        // prompt user to install the extended build or use an alternative
    } else {
        return err
    }
}

Prevention

When it happens

Trigger: Calling resources.ToCSS with the libsass compiler (or a similar optional feature) in a Hugo binary built without the corresponding build tag or library.

Common situations: Using a non-extended Hugo distribution; SCSS via libsass when only the built-in transpiler is available; a feature flagged off in the installed version.

Related errors


AI-assisted analysis of gohugoio/hugo@52c9bd7908 (2026-08-09). Data as JSON: /api/errors/ee5924886fbc795e. Report an issue: GitHub.