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 encountered while saving cache ... can't dump hash with default proc #331

Closed
donmb1 opened this issue May 28, 2015 · 16 comments
Closed

Comments

@donmb1
Copy link

donmb1 commented May 28, 2015

When deploying to heroku:

Error encountered while saving cache 59577ac82f2c1623e01184f55995a44284ee07e8/main.sassc: can't dump hash with default proc

Not really reproduceable but I read about this issue but with older versions of sass-rails.

gemfile.lock

sass (3.4.13)
sass-rails (5.0.3)
...railties (>= 4.0.0, < 5.0)
...sass (> 3.1)
...sprockets (>= 2.8, < 4.0)
...sprockets-rails (>= 2.0, < 4.0)
...tilt (
> 1.1)

Need more info?

@rafaelfranca
Copy link
Member

Can you please provide a sample application that reproduces the error?

@donmb1
Copy link
Author

donmb1 commented May 29, 2015

Ok, give me some time, will prepare it.

@donmb1
Copy link
Author

donmb1 commented May 29, 2015

There you go: https://github.com/MartinB83/sass-test

just deployed on heroku stack https://stark-savannah-7379.herokuapp.com/
lmk if you need collaboration access

@donmb1
Copy link
Author

donmb1 commented Jun 15, 2015

Any idea here?

@enriquetuya
Copy link

Hi Martin, did you manage to solve this issue? I run into the same error just now.
Thanks!

    sass (3.4.14)
    sass-rails (5.0.3)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (~> 1.1)

@donmb1
Copy link
Author

donmb1 commented Jul 8, 2015

Hi. No, unfortunately not and the error still persists. Luckily it does not have any impact yet. I just see it in the deployment log.

@enriquetuya
Copy link

Martin, I've checked your test project with mine. The issue is related to the import of the google font:

@import url(http://fonts.googleapis.com/css?family=Hind:300,700)

If you remove that import you stop receiving the warning. I'll be checking the documentation to see if we are doing something wrong or if there is a reported bug related to it. I'll let you know if I have any luck.

@donmb1
Copy link
Author

donmb1 commented Jul 8, 2015

ok thank you, will try to change it

@enricostano
Copy link

Hi there I'm getting the same warning, any news about it? I can share my logs if needed.

@harigopal
Copy link

I'm seeing the same thing, using active_skin (https://github.com/rstgroup/active_skin), on my Heroku project:

Warning. Error encountered while saving cache 9f4444befdf64451ebca1af556e4588e2120aeb4/active_skin.sassc: can't dump hash with default proc

Something about the Heroku environment triggering the error? Could be linked to @import of google fonts, as @enriquetuya suggested (active_skin does this too):

https://github.com/rstgroup/active_skin/blob/master/app/assets/stylesheets/active_skin.sass#L1

However, the import directive seems to be processed correctly.

@jtomaszewski
Copy link

I get the same error with activeskin file very often on my development environment. Unfortunately, because of that the error slows the rendering time of my css a lot.

After a bit of debugging, indeed, the problem lies in the @import directive of the google css file. Propably sass thinks its a .sass file and wants to download it or something, I don't know.

P.S. If someone has this issue atm with active_skin, u can do what I did:

  1. Copy the active_skin.sass file to your own app and remove the @import directive.
  2. Add the gfont using activeadmin initializer config: config.register_stylesheet '//fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700&subset=latin,latin-ext'

isacaraujo pushed a commit to isacaraujo/active_skin that referenced this issue Mar 29, 2016
TODO: Create a Way to extend the ActiveAdmin configure file.
@devkinetic
Copy link

Hit this error today as well

deivid-rodriguez pushed a commit to nolotiro/nolotiro.org that referenced this issue Jun 25, 2016
It's causing an error with latest sass-rails: rails/sass-rails#331.
deivid-rodriguez pushed a commit to nolotiro/nolotiro.org that referenced this issue Jun 27, 2016
It's causing an error with latest sass-rails: rails/sass-rails#331.
deivid-rodriguez pushed a commit to nolotiro/nolotiro.org that referenced this issue Jun 29, 2016
It's causing an error with latest sass-rails: rails/sass-rails#331.
@midwire
Copy link

midwire commented Jul 29, 2016

Hit this error today as well

sass (3.4.22)
sass-rails (5.0.6)
  railties (>= 4.0.0, < 6)
  sass (~> 3.1)
  sprockets (>= 2.8, < 4.0)
  sprockets-rails (>= 2.0, < 4.0)
  tilt (>= 1.1, < 3)

The fonts still render in the browser but are excluded from the cache. It's not a huge performance hit per request, but it adds up.

We are not using active_skin or middleman, just plain old sass with google fonts:

We've tried the following variations with no joy:

@import url(https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Open+Sans:400,600,700)
@import url(http://fonts.googleapis.com/css?family=Montserrat:400,600,700|Open+Sans:400,600,700)
@import url("http://fonts.googleapis.com/css?family=Montserrat:400,600,700|Open+Sans:400,600,700")
@import url(//fonts.googleapis.com/css?family=Montserrat:400,600,700|Open+Sans:400,600,700)

Commenting the @import line out stops the error but of course does not use the desired fonts.

UPDATE: downloading the .css file directly for https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Open+Sans:400,600,700, saving it in a .css file and importing that instead does work around this error.

@midwire
Copy link

midwire commented Jul 29, 2016

Further investigation reveals a similar issue to this:

  • A Sass::CacheStores::Base instance attempts (and fails) to call Marshal.dump on :
  • A Sass::Tree::RootNode instance which amongst its @children nodes has :
  • A Sass::Tree::CssImportNode instance which amongst its attributes has :
  • A :uri which is an instance of Sass::Script::Tree::Funcall which fails when trying to call Marshall.dump on it
  • The Sass::Script::Tree::Funcall instance has two attributes (args, options) both of which fail when trying to call Marshall.dump on them.

Like @srgpqt, I do not have enough knowledge of the sass internals to provide a fix yet. Maybe this problem doesn't belong here at all anyway but instead in the sass repo?

Update: Cross posted here: sass/sass#2110

@TheFlow0360
Copy link

Is there any solution to this yet, besides copying stuff around? I'm using active_skin, too, and I'd like to avoid copying the CSS into my project instead of simply using the gem...

@galtzo
Copy link

galtzo commented Jan 3, 2019

Copying the google fonts CSS into my project was the fix for me. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests