gohugoio/hugo · error

unsupported Dart Sass version detected, please upgrade to…

Error message

unsupported Dart Sass version detected, please upgrade to Dart Sass 1.63.0 or later, see https://gohugo.io/functions/css/sass/#dart-sass

What it means

Returned by the Dart Sass client constructor when a Dart Sass binary IS found but its version is below the minimum supported (>= 1.63.0), detected via hugo.IsDartSassGeV2() returning false. Older Dart Sass versions lack APIs Hugo depends on.

Solutions

  1. Upgrade Dart Sass to 1.63.0 or newer (ideally latest): `npm install -g sass@latest` or download the newest dart-sass-embedded release.
  2. Confirm with `sass --version` that the reported version is >= 1.63.0.
  3. If you cannot upgrade, switch transpiler to 'libsass' (Hugo extended) as a temporary workaround.

Example fix

// before
$ sass --version
1.54.0

// after
$ npm install -g sass@latest
$ sass --version
1.77.0
Defensive patterns

Strategy: validation

Validate before calling

// Check Dart Sass version >= 1.63.0 before building.
func dartSassVersionOK() bool {
    out, err := exec.Command("sass", "--version").Output()
    if err != nil { return false }
    v := strings.TrimSpace(string(out))
    // parse leading semver major.minor.patch
    return semverCompare(v, "1.63.0") >= 0
}

Prevention

When it happens

Trigger: css.Sass/ToCSS with transpiler='dartsass' on a machine with an outdated sass binary (e.g. 1.5x or early 1.6x). New() finds the binary, then the version gate fails.

Common situations: A system/CI image shipping an old sass package, an old npm global install, or pinning dart-sass to a legacy version for another project.

Related errors


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

Appendix: source

Thrown at resources/resource_transformers/tocss/dartsass/client.go:56

// used as part of the cache key.
const transformationName = "tocss-dart"

// See https://github.com/sass/dart-sass-embedded/issues/24
// Note: This prefix must be all lower case.
const dartSassStdinPrefix = "hugostdin:"

func New(fs *filesystems.SourceFilesystem, rs *resources.Spec) (*Client, error) {
	if !Supports() {
		return &Client{}, nil
	}

	if hugo.DartSassBinaryName == "" {
		return nil, fmt.Errorf("no Dart Sass binary found in $PATH")
	}

	if !hugo.IsDartSassGeV2() {
		return nil, fmt.Errorf("unsupported Dart Sass version detected, please upgrade to Dart Sass 1.63.0 or later, see https://gohugo.io/functions/css/sass/#dart-sass")
	}

	if err := rs.ExecHelper.Sec().CheckAllowedExec(hugo.DartSassBinaryName); err != nil {
		return nil, err
	}

	var (
		transpiler *godartsass.Transpiler
		err        error
		infol      = rs.Logger.InfoCommand("Dart Sass")
		warnl      = rs.Logger.WarnCommand("Dart Sass")
	)

	transpiler, err = godartsass.Start(godartsass.Options{
		DartSassEmbeddedFilename: hugo.DartSassBinaryName,
		LogEventHandler: func(event godartsass.LogEvent) {
			message := strings.ReplaceAll(event.Message, dartSassStdinPrefix, "")
			switch event.Type {

View on GitHub (pinned to 52c9bd7908)