Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement for message if a class uses @extends accidentally a second time #1393

Closed
Jugibur opened this issue Jul 11, 2021 · 1 comment · Fixed by #1438
Closed

Improvement for message if a class uses @extends accidentally a second time #1393

Jugibur opened this issue Jul 11, 2021 · 1 comment · Fixed by #1438
Assignees
Labels

Comments

@Jugibur
Copy link

Jugibur commented Jul 11, 2021

Hi,
I'm in the process of changing a third-party WordPress theme that still uses "@import" to "@use".
Thereby a class was extended via @extend a second time in two different files.
Following a simplified example:

File "import-for-extend.scss":
%to-extend { outline: 1px solid red; } .class1 { @extend %to-extend; }
File "test.scss":
@use "import-for-extend" as *; .class1 { @extend %to-extend; }
With this constellation the following error message appears:

Error: The target selector was not found.
Use "@extend %to-extend !optional" to avoid this error.

Of course extending something a second time makes no sense but it took a while in this large Sass project to find out the reason. I think the Sass message should be informing about this equal extendings not that the selector was not found.

@Awjin
Copy link
Contributor

Awjin commented Aug 11, 2021

Sorry for the late reply here. This looks like an actual bug caused by @use's interaction with @extend.

@Awjin Awjin added the bug label Aug 11, 2021
nex3 added a commit to sass/sass-spec that referenced this issue Aug 11, 2021
nex3 added a commit that referenced this issue Aug 11, 2021
We weren't properly merging multiple @extend rules that were added to
an upstream module at the same time, so some of them weren't being
marked as satisfied.

Closes #1393
nex3 added a commit that referenced this issue Aug 12, 2021
We weren't properly merging multiple @extend rules that were added to
an upstream module at the same time, so some of them weren't being
marked as satisfied.

Closes #1393
@nex3 nex3 self-assigned this Aug 12, 2021
nex3 added a commit to sass/sass-spec that referenced this issue Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants