rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
542 stars 97 forks source link

Fails to load a CSS file with url(data:...) image assets. #103

Closed syntruth closed 11 years ago

syntruth commented 11 years ago

I recently upgraded to a new version of a jQuery-UI theme and AssetPack would fail on serving the ui css file.

Here is the top portion of the traceback:

NoMethodError - undefined method `squeeze' for nil:NilClass:
  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-assetpack-0.2.1/lib/sinatra/assetpack/options.rb:236:in `local_file_for'
  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-assetpack-0.2.1/lib/sinatra/assetpack/css.rb:11:in `block in preproc'
  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-assetpack-0.2.1/lib/sinatra/assetpack/css.rb:7:in `gsub'
  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-assetpack-0.2.1/lib/sinatra/assetpack/css.rb:7:in `preproc'
  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-assetpack-0.2.1/lib/sinatra/assetpack/helpers.rb:55:in `asset_filter_css'
  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-assetpack-0.2.1/lib/sinatra/assetpack/class_methods.rb:79:in `block (3 levels) in add_individual_routes!'
  /usr/local/lib/ruby/gems/1.9.1/gems/tilt-1.3.7/lib/tilt.rb:127:in `fetch'
  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-assetpack-0.2.1/lib/sinatra/assetpack/class_methods.rb:79:in `block (2 levels) in add_individual_routes!'
  /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1414:in `call'

..after some digging, comparing old UI css with the new one, I have found it was this line in the newer UI css file:

/* support: IE10, see #8844 */
list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);

Removing that line (commenting it out didn't help) fixed the issue and it started to serve the new UI file again.

j15e commented 11 years ago

Thanks for reporting, will look into this bug, should have been fix by https://github.com/rstacruz/sinatra-assetpack/commit/90971383686679d91f7af85c39db607d8dd42e56

Are you using latest version?

syntruth commented 11 years ago

Good question, I don't think I recently updated my Bundle. Will do so Tuesday morning when I get back to the office. ;)

j15e commented 11 years ago

All right thanks!

syntruth commented 11 years ago

I was a couple versions behind. Non issue! Sorry. :)