gohugoio/hugo · error · FeatureNotAvailableError

ErrFeatureNotAvailable

ErrFeatureNotAvailable

Error message

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

What it means

ErrFeatureNotAvailable (a FeatureNotAvailableError defined in common/herrors/errors.go:87) signals that a feature exists in Hugo but is not compiled into or supported by the binary you are running. It was introduced for optional build-tag features like SCSS/Sass via libsass, which only the 'extended' Hugo build includes. Callers wrap it so IsFeatureNotAvailableError can detect it and print a helpful message pointing to https://goo.gl/YMrWcn.

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 8a468df065)

Solutions

  1. Install the extended edition of Hugo (download hugo_extended from GitHub releases, or 'brew install hugo' which is extended) and verify with 'hugo version' showing '+extended'.
  2. In CI, pin the extended binary (e.g. set HUGO_VERSION and use the extended asset in Netlify/GitHub Actions).
  3. If building from source, compile with the required tag: CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest.
  4. Alternatively, switch the site to Dart Sass (hugo mod / installing dart-sass) or drop the SCSS pipeline if you cannot use extended.

Example fix

# before (CI)
wget https://github.com/gohugoio/hugo/releases/download/v0.148.0/hugo_0.148.0_linux-amd64.tar.gz

# after
wget https://github.com/gohugoio/hugo/releases/download/v0.148.0/hugo_extended_0.148.0_linux-amd64.tar.gz
Defensive patterns

Strategy: type-guard

Validate before calling

// Check the running Hugo version supports the feature before using it
if !hugo.IsAtLeast("0.148.0") { skipFeature() }

Type guard

func isFeatureUnavailable(err error) bool {
    return herrors.IsFeatureNotAvailableError(err) // or errors.Is(err, herrors.ErrFeatureNotAvailable)
}

Try / catch

if err := run(); errors.Is(err, herrors.ErrFeatureNotAvailable) {
    // degrade gracefully or tell the user to upgrade Hugo / use the extended build
}

Prevention

When it happens

Trigger: Invoking a feature your binary lacks: transforming SCSS/Sass with css.Sass (toSCSS) on a non-extended Hugo build; using WebP or other encoders excluded by build tags; any code path that returns or wraps herrors.ErrFeatureNotAvailable.

Common situations: Installing standard Hugo instead of hugo_extended (common with apt, brew formula variants, CI docker images, or Netlify/Vercel default binaries) and then building a theme that uses SCSS; downgrading Hugo and losing a feature the site depends on; running a self-compiled binary without the required build tags (e.g. 'extended').

Related errors


AI-assisted analysis of gohugoio/hugo@8a468df065 (2026-07-31). Data as JSON: /data/errors/101f7ff24183731b.json. Report an issue: GitHub ↗.