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

Error when passing fractions for gutter sizes #408

Closed
lmartins opened this issue Nov 30, 2014 · 17 comments
Closed

Error when passing fractions for gutter sizes #408

lmartins opened this issue Nov 30, 2014 · 17 comments

Comments

@lmartins
Copy link

With the following settings:

$susy: (
    columns: 12,
    gutters: 1/4,
    math: fluid,
    output: float,
    gutter-position: inside,
);

I get:

17:02:18] gulp-notify: [Error running Gulp] stdin:69: may only compare numbers

Error: { [Error: stdin:69: may only compare numbers
]
  message: 'stdin:69: may only compare numbers\n',
  showStack: false,
  showProperties: true,
  plugin: 'gulp-sass',
  __safety: { toString: [Function] } }

If I change that property to a pixel value it compiles without errors.

The columnspropertydoesn't work when using asymmetrical gridscolumns: (1 1 2 3 5 8 13),`.
This returns the following:

[gulp] Starting 'sass'...
[gulp] Finished 'sass' after 2.01 ms
[17:09:46] gulp-notify: [Error running Gulp] /Users/luismartins/Sites/LAB/libsass/src/vendor/susy/sass/susy/su/grid:75: index out of bounds for `nth($list, $n)`

Error: { [Error: /Users/luismartins/Sites/LAB/libsass/src/vendor/susy/sass/susy/su/grid:75: index out of bounds for `nth($list, $n)`
]
  message: '/Users/luismartins/Sites/LAB/libsass/src/vendor/susy/sass/susy/su/grid:75: index out of bounds for `nth($list, $n)`\n',
  showStack: false,
  showProperties: true,
  plugin: 'gulp-sass',
  __safety: { toString: [Function] } }

Im running node-sass-1.2.3

@christianmagill
Copy link

I can confirm the "may only compare numbers" error as well using gulp-sass@beta

I got around the issue by putting parenthesis around the fraction.

@mirisuzanne
Copy link
Member

That sounds like a bug in LibSass. We may be able to find a workaround on our end, but better to file an issue over there.

@lmartins
Copy link
Author

lmartins commented Dec 1, 2014

Sure, I can do that. I'll have a look into the source to see in which context this code triggers the error. If you know that from memory please let me know, just to make the Libsass ticket as clear as possible.

@mirisuzanne
Copy link
Member

I wont be able to look into this more until later in the day. If you have time to track it down before then, go ahead.

@mirisuzanne
Copy link
Member

Documented: sass/libsass#682

LibSass doesn't yet support fractions.

@lmartins
Copy link
Author

lmartins commented Dec 2, 2014

Thank you Eric.
Since it already has an issue open in libsass im closing this if that's ok with you.

@lmartins lmartins closed this as completed Dec 2, 2014
@reintroducing
Copy link

I'm using gulp-sass 1.3.2 and the latest version of susy. I'm still getting this error even though when you track this to the libsass ticket as well as the one linked there this should be fixed. Any ideas? This is all I have in my sass file and it's throwing the same error still.

$susy: (
    columns: 12,
    gutters: 1/4
);

@mirisuzanne
Copy link
Member

Following the trail of dependencies, I'm not sure that the latest gulp-sass includes the latest libsass yet. Looks to me like node-sass is several versions behind.

The last two releases of libsass (3.1.0-beta.2 and 3.1.0) are not yet available in node-sass, and therefor also not in gulp-sass

@reintroducing
Copy link

Ah, thanks for following up so quickly on this. That definitely makes sense. I REALLY want to adopt libsass already due to the incredibly slow compile times from the ruby version but it's still a little rough around the edges :\

@hutber
Copy link

hutber commented Feb 16, 2015

Just giving everybody a heads up who might be having problems like this.

I had to update libsass to 3.1.0-beta.2 and then inside my sass use (1/4) rather than just 1/4. This will force it to be treated as a number.

Taken from here:
sass/libsass#590

I am unsure if updating node-sass's dependances to use the beta helped at all. But its working right now so I can't test if that was a necessary step.

@timmyomahony
Copy link

I'm also suddenly having an issue with this. Everything was working fine and somewhere along the chain of dependencies there was obviously an update that's caused this to show its head.

I'm using:

grunt-sass v0.18.0
node-sass v2.0.1
libsass (OSX) v3.1.0

I haven't been able to fix it yet and have just switched from grunt-sass to grunt-contrib-sass

(I know this isn't an issue with susy but that's how it manifested itself and might be useful for someone searching via Google.)

@tomazzaman
Copy link

A workaround is to define the gutter width outside map, like so:

$gutters: 1/4;

$susy: (
  global-box-sizing: border-box,
  math: static,
  columns: 12,
  column-width: 70px,
  gutters: $gutters,
  container: auto,
  container-position: center,
);

@christianmagill
Copy link

Wrapping fraction in parenthesis also seems to work.
On Sun, Mar 1, 2015 at 2:09 PM Tomaž Zaman notifications@github.com wrote:

A workaround is to define the gutter width outside map, like so:

$gutters: 1/4;

$susy: (
global-box-sizing: border-box,
math: static,
columns: 12,
column-width: 70px,
gutters: $gutters,
container: auto,
container-position: center,
);


Reply to this email directly or view it on GitHub
#408 (comment).

@mirisuzanne
Copy link
Member

It looks to me like node-sass, grunt-sass, and gulp-sass have all been updated — so this should not cause an error any more. Have you tried updating your dependencies?

@DenisMir
Copy link

@ericam
I'm still getting this error.

These are my grid settings:

$grid: (columns: 12, column-width: false, gutters: 1 / 1.618, gutter-position: after, math: fluid);

When having something like that:

.col__b0-full {
  @include span(full);
}

I'm getting the may only compare numbers error. I'm using the latest node-sass version which uses 3.1.

Any suggestions?

@Reklino
Copy link

Reklino commented May 1, 2015

This still seems to be an issue. Here are my grid settings:

$susy: (
    columns: 3,
    gutters: 1/4,
    gutter-position: inside,
    container: 450px
);

I've started using .25 instead of 1/4 for now.

@mirisuzanne
Copy link
Member

Yeah, they fixed the error with fractions more generally, but not fractions retrieved from a map as far as I can tell. I filed sass/libsass#1159 to track it, and released 2.2.3 with the default changed. I'll keep this issue open, with a blocked-by-sass tag.

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

9 participants