diff --git a/CHANGELOG.md b/CHANGELOG.md index 74ecdb529..0fe79b900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.43.2 + +* Improve the error message when the default namespace of a `@use` rule is not + a valid identifier. + ## 1.43.1 * No user-visible changes. diff --git a/lib/src/parse/stylesheet.dart b/lib/src/parse/stylesheet.dart index afe741594..5685f151c 100644 --- a/lib/src/parse/stylesheet.dart +++ b/lib/src/parse/stylesheet.dart @@ -1398,7 +1398,11 @@ abstract class StylesheetParser extends Parser { try { return Parser.parseIdentifier(namespace, logger: logger); } on SassFormatException { - error('Invalid Sass identifier "$namespace"', scanner.spanFrom(start)); + error( + 'The default namespace "$namespace" is not a valid Sass identifier.\n' + "\n" + 'Recommendation: add an "as" clause to define an explicit namespace.', + scanner.spanFrom(start)); } } diff --git a/pubspec.yaml b/pubspec.yaml index 7268857ca..f2dff30f8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.43.1 +version: 1.43.2-dev description: A Sass implementation in Dart. homepage: https://github.com/sass/dart-sass