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

libsass does not give errors for missing imported base class in @extend #871

Closed
akshat1 opened this issue Feb 2, 2015 · 7 comments
Closed

Comments

@akshat1
Copy link

akshat1 commented Feb 2, 2015

Given the following code


.bar {
  @extend .foo;
  color: green;
}

ruby-sass gives the following error:


Error: ".bar" failed to @extend ".foo".
       The selector ".foo" was not found.
       Use "@extend .foo !optional" if the extend should be able to fail.
        on line 4 of bar.scss
  Use --trace for backtrace.

While libsass (by way of node-sass) gives:


.bar {
  color: green; }

This was performed using node-sass (2.0.0-beta). I think libsass should also throw an error instead of proceeding with the compilation. My apologies if I am seeing this incorrectly.

@akshat1 akshat1 changed the title libsass doesn't give errors for missing imported base class in @extend libsass does not give errors for missing imported base class in @extend Feb 2, 2015
@yonidor
Copy link

yonidor commented Feb 15, 2015

+1 encountered the same issue

@jananananana
Copy link

+1, using Sass 3.4, seeing same issue

@xzyfer xzyfer added this to the 3.2 milestone Feb 19, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Feb 19, 2015

Thanks for the reports. I'll try to get this into our next release.

@mgreter mgreter self-assigned this Mar 8, 2015
@mgreter
Copy link
Contributor

mgreter commented Mar 9, 2015

This one is also trickier than expected. @xzyfer you added the 3.2 Milestone for this, so do you have an idea how to fix this? I was able to tackle the missing error when extending across media queries, but this one seems more difficult, since extend seems to be run twice, which makes my check in the WIP branch fail on the second run. Otherwise I don't think I can fix this for 3.2!

@mgreter mgreter removed their assignment Mar 9, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Mar 9, 2015

@mgreter the way to handle this is by setting metadata on the extends in the cssize visitor. This isn't a difficult fix to the looks of it, I'm just not sure if I'll the time before 3.2.0. I'm pretty much out of action this month.

You can see the Ruby sass implementation in the cssize visitor and the actual error in the extend visitor.

IMO this is non-critical and can be delayed to 3.3 if it's the only 3.2 blocker.

@mgreter mgreter mentioned this issue Mar 9, 2015
@mgreter
Copy link
Contributor

mgreter commented Mar 9, 2015

Rescoping to 3.3, since it is a non trivial refactoring and we consider this issue a minor one, because it only happens with "invalid" input. As a drop-in replacement, libsass does not break, since ruby sass would not create any output anyway! We still consider it a bug, but will not have a fix in 3.2!

@mgreter mgreter modified the milestones: 3.3, 3.2 Mar 9, 2015
mgreter added a commit to mgreter/sass-spec that referenced this issue Mar 30, 2015
@mgreter mgreter modified the milestones: 3.3.1, 3.3 Jun 13, 2015
saper pushed a commit to saper/sass-spec that referenced this issue Sep 20, 2015
saper pushed a commit to saper/sass-spec that referenced this issue Sep 21, 2015
saper pushed a commit to saper/sass-spec that referenced this issue Sep 21, 2015
saper pushed a commit to saper/sass-spec that referenced this issue Sep 21, 2015
@xzyfer xzyfer modified the milestones: 3.3.1, 3.3.2 Oct 26, 2015
@xzyfer xzyfer modified the milestones: 3.3.2, 3.3.3 Nov 4, 2015
@xzyfer xzyfer modified the milestones: 3.4, 3.3.3 Dec 28, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Dec 28, 2015

Rescoped to 3.4 since this doesn't prevent people migrating to LibSass from Ruby Sass.

@mgreter mgreter modified the milestones: 3.3.3, 3.4 Jan 11, 2016
@mgreter mgreter self-assigned this Jan 11, 2016
xzyfer added a commit to xzyfer/sass-spec that referenced this issue Jan 12, 2016
This PR activates specs for sass/libsass#871
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants