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

Already on GitHub? Sign in to your account

Warning. Error encountered while saving cache [...] can't dump anonymous class [...] #1144

gabrielecirulli opened this Issue Mar 3, 2014 · 9 comments


None yet
7 participants

I noticed this issue today while working on a Rails app and looking at the console output after refreshing a page on the development server.

Whenever any of the scss files is modified, reloading the page takes a few seconds longer, and those messages appear in the console.

I only noticed this today and I might have accidentally triggered it, even though the only thing I recall doing that might have caused it is accidentally deleting the public/assets directory, but I'm not sure if it has any relevance to this issue.

I don't recall noticing the messages before, but it's not the first time requests run slower when the stylesheets are changed, so I think those messages could have been there for a while.

Here's an example of the full log of a request when this happens.

These messages don't appear in the console on subsequent requests and they come back only if I modify any of the SCSS files in my projects.

Here are my Gemfile and my Gemfile.lock. I think I should be running all of the most up-to-date versions of the relevant gems.

Here is all of the SCSS in my application. It should mostly be normal.

Even though I'm using the sass-rails, bourbon, bootstrap-sass gems, I could still reproduce the issue even when every single line of code in application.css.scss is commented out:

Warning. Error encountered while saving cache f8e28779d0d3a15ff97bdadaa7307304e4f35ec1/application.css.scssc: can't dump anonymous class #<Class:0x000001081e6910>

I tried searching for this error and came up with a few issues created in the past (one was from 3 years ago) but none of the solutions I found were conclusive or relevant to my case.

I am sorry that I can't give you any more specific information on how to reproduce this. The Rails app I'm working on is closed-source, but if you need it I can give you private access to it and let you run the code for yourself.

I posted this issue on this repository because searching for the error message seems to point to this specific file.

Please feel free to ask for further information regarding anything if it is likely to help you find the cause of this issue.



nex3 commented Mar 3, 2014

Duplicate of #1028. I believe the conclusion of that bug was that future versions of Sprockets will avoid this issue.

@nex3 nex3 closed this Mar 3, 2014

That's good but I would also like to know if this is an issue I'm having due to a specific condition I'm having or endemic to any app that uses sass/sprockets. I'm currently using the latest version of sprockets available, and it's still there. Do you know anything about when it'll be fixed?


nex3 commented Mar 3, 2014

I believe this will occur with any app that uses sass 3.3 with sprockets. You'd have to ask the sprockets folks when it will be fixed.

Thanks, I’ll give it a try.

Did anyone get anywhere with this/is it being looked at? I've mentioned in #1028 that the issue is re-creatable right out of the box without writing a line of code.

simi commented May 16, 2014

Upgrade to latest sass resolved this for me.

Interesting lines from Gemfile.lock:

    sass (3.3.7)
    sass-rails (4.0.1)
    sprockets (2.11.0)
    sprockets-rails (2.0.1)

@mfrederickson mfrederickson referenced this issue in concerto/concerto May 22, 2014


errors occur while saving cache #930

Didn't do it for me:

www (master) • bundle show sass
bundle show /Users/ericfields/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/sass-3.3.7
swww (master) • bundle show sass-rails
bundle /Users/ericfields/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/sass-rails-4.0.1
shwww (master) • bundle show sprockets
bundle show /Users/ericfields/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/sprockets-2.11.0
www (master) • bundle show sprockets-rails

@YusiFan YusiFan referenced this issue in MarkUsProject/Markus Dec 3, 2014


Rails 4 - scss warnings in server log #1924

Interesting. It worked for me when i cleared the rails cache.

This works for me, first you may want to bundle update sass && sass-rails then

gem uninstall sass
bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment