{"record":{"id":"1232d53cadbbadcd","repo":"gohugoio/hugo","slug":"unsupported-dart-sass-version-detected-please-upg","errorCode":null,"errorMessage":"unsupported Dart Sass version detected, please upgrade to Dart Sass 1.63.0 or later, see https://gohugo.io/functions/css/sass/#dart-sass","messagePattern":"unsupported Dart Sass version detected, please upgrade to Dart Sass 1\\.63\\.0 or later, see https://gohugo\\.io/functions/css/sass/#dart-sass","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"resources/resource_transformers/tocss/dartsass/client.go","lineNumber":56,"sourceCode":"\n// used as part of the cache key.\nconst transformationName = \"tocss-dart\"\n\n// See https://github.com/sass/dart-sass-embedded/issues/24\n// Note: This prefix must be all lower case.\nconst dartSassStdinPrefix = \"hugostdin:\"\n\nfunc New(fs *filesystems.SourceFilesystem, rs *resources.Spec) (*Client, error) {\n\tif !Supports() {\n\t\treturn &Client{}, nil\n\t}\n\n\tif hugo.DartSassBinaryName == \"\" {\n\t\treturn nil, fmt.Errorf(\"no Dart Sass binary found in $PATH\")\n\t}\n\n\tif !hugo.IsDartSassGeV2() {\n\t\treturn 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\")\n\t}\n\n\tif err := rs.ExecHelper.Sec().CheckAllowedExec(hugo.DartSassBinaryName); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar (\n\t\ttranspiler *godartsass.Transpiler\n\t\terr        error\n\t\tinfol      = rs.Logger.InfoCommand(\"Dart Sass\")\n\t\twarnl      = rs.Logger.WarnCommand(\"Dart Sass\")\n\t)\n\n\ttranspiler, err = godartsass.Start(godartsass.Options{\n\t\tDartSassEmbeddedFilename: hugo.DartSassBinaryName,\n\t\tLogEventHandler: func(event godartsass.LogEvent) {\n\t\t\tmessage := strings.ReplaceAll(event.Message, dartSassStdinPrefix, \"\")\n\t\t\tswitch event.Type {","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/resources/resource_transformers/tocss/dartsass/client.go#L38-L74","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade Dart Sass to 1.63.0 or newer (ideally latest): `npm install -g sass@latest` or download the newest dart-sass-embedded release.","Confirm with `sass --version` that the reported version is >= 1.63.0.","If you cannot upgrade, switch transpiler to 'libsass' (Hugo extended) as a temporary workaround."],"exampleFix":"// before\n$ sass --version\n1.54.0\n\n// after\n$ npm install -g sass@latest\n$ sass --version\n1.77.0","handlingStrategy":"validation","validationCode":"// Check Dart Sass version >= 1.63.0 before building.\nfunc dartSassVersionOK() bool {\n    out, err := exec.Command(\"sass\", \"--version\").Output()\n    if err != nil { return false }\n    v := strings.TrimSpace(string(out))\n    // parse leading semver major.minor.patch\n    return semverCompare(v, \"1.63.0\") >= 0\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin Dart Sass to a recent release in CI (`npm install -g sass@latest`).","Add `sass --version` to CI and assert >= 1.63.0.","Document the minimum supported version in the project README."],"tags":["dart-sass","sass","version-mismatch","environment"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}