Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Incorrect line numbers for errors outside blocks #3147

@GCorbel

Description

@GCorbel

When an error is made outside a block, the line number in the error is incorrect.

input.scss

.my-class {
  text-align: left;
  color: red;
}
.something-wrong-at-line-5 }

Actual results

The error is marked on line 4.
libsass 3.6.4

Error: Invalid CSS after "}": expected 1 selector or at-rule, was ".something-wrong-at"
        on line 4:2 of ../../../tmp/test.scss
>> }

   -^

Expected result

The error is correctly set on line 4 with Ruby Sass.
ruby sass 3.7.4

Error: Invalid CSS after "...rong-at-line-5 ": expected "{", was "}"
        on line 5 of /tmp/test.scss

The error is correctly set on line 4 with Dart Sass.
dart-sass 1.32.8 compiled with dart2js 2.10.5
version info:

Error: expected "{".
  ╷
5 │ .something-wrong-at-line-5 }
  │                            ^
  ╵
  /tmp/test.scss 5:28  root stylesheet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions