error compiling: array size too big for `sprite' #1022

jerseycheese opened this Issue Sep 13, 2012 · 13 comments


None yet

5 participants

This error has come out of nowhere and is preventing us from compiling and closing out a project. It seems as if any usage of sprite() is throwing the error, but here's an example of how it's being used throughout our stylesheet:

background: sprite($icons, name-of-file, $offset-x: 5px, $offset-y: 12px) no-repeat #e9e9e9;

Thanks for any help!

I should mention:

OSX 10.7.4
Sass 3.2.1 (Media Mark)
Compass 0.12.2 (Alnilam)


how many images are in this sprite?

About 40 or so.

There were about 80 originally but I took a bunch out thinking it was the amount of images throwing the error. But it's still choking.

mndonx commented Sep 14, 2012

I'm working on this project with jerseycheese. I just created a fresh scss file, added in about 40 lines of code that compiles fine (no sprites). Then I add just one line like:

background: sprite($icons, png-name, $offset-x: 100%, $offset-y: 0) no-repeat;
@include sprite-replace-text-with-dimensions($icons, png-name);

Ruby crashes and I have to force quit from Activity Monitor. I'm not getting a good log message from LiveReload or Console.

Strangely other similar files (on similar projects) do not choke -- and this just started happening a few days ago on this file. It's happening to both of us, on different machines.

Any thoughts on further ways to troubleshoot? This happened once before to me, and went away when I reinstalled ruby and gems. That didn't help this time around.

OSX 10.8 (just upgraded from 10.7 yesterday)
Live Reload 2.3.20
Compass 0.12.2 (Alnilam)
Sass 3.2.1 (Media Mark)
System Ruby 1.8.7 (also tried using Ruby 1.9.2p320)


im curious if you have a corrupted png file can you get a full stack trace?

mndonx commented Sep 15, 2012

Indeed, this was the issue. It wasn't easy to find (had to use process of elimination), but there was a corrupt PNG in there. Any suggestions on how to locate it in the future if it happens again?


if you have a full stack trace I can probably make it catch the exception if i know what im looking for

mndonx commented Sep 17, 2012

Sorry - I'm not sure what a full stack trace is. Or rather - how to produce one in this instance.

mndonx commented Sep 17, 2012

And by the way, thank you for pointing me in the right direction without much info to go on! I appreciate your time.

@scottdavis scottdavis closed this Oct 16, 2012

Just wanted to say thank you for documenting this issue! I got the same error today and a quick search led me here. I had a corrupted png file in my sprite folder, and once I located the culprit 😓 I was able to re-save it and then the sprite generation was working fine. 👍 Thanks again!

mndonx commented Jul 4, 2013

:) Glad this helped!

Actually it also helped a lot 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment