Giter Club home page Giter Club logo

Comments (3)

adamburmister avatar adamburmister commented on August 29, 2024

I'm opening up the gem and trying to debug the issue: for your reference this is the parser options hash being generated:

{:filename=>"/Users/adam/Development/backchatio-marketing/app/assets/stylesheets/homepage.css.less", :line=>1, :paths=>["/Users/adam/Development/backchatio-marketing/app/assets/stylesheets", "/Users/adam/Development/backchatio-marketing/vendor/assets/stylesheets", "/Users/adam/.rvm/gems/ruby-1.9.2-p180/gems/less-rails-bootstrap-1.4.2/vendor/assets/stylesheets", "/Users/adam/.rvm/gems/ruby-1.9.2-p180/gems/less-rails-bootstrap-1.4.2/vendor/frameworks", "/Users/adam/Development/backchatio-marketing/app/assets/fonts", "/Users/adam/Development/backchatio-marketing/app/assets/images", "/Users/adam/Development/backchatio-marketing/app/assets/javascripts", "/Users/adam/Development/backchatio-marketing/app/assets/stylesheets", "/Users/adam/Development/backchatio-marketing/vendor/assets/stylesheets", "/Users/adam/.rvm/gems/ruby-1.9.2-p180/gems/jquery-rails-1.0.19/vendor/assets/javascripts", "/Users/adam/.rvm/gems/ruby-1.9.2-p180/gems/less-rails-bootstrap-1.4.2/vendor/assets/javascripts", "/Users/adam/.rvm/gems/ruby-1.9.2-p180/gems/less-rails-bootstrap-1.4.2/vendor/assets/stylesheets"]}

Opening the parser.js file and dumping out the tree.functions object's keys I find the following, which indicates they are there and available for use:

rgb,rgba,hsl,hsla,hue,saturation,lightness,alpha,saturate,desaturate,lighten,darken,fadein,fadeout,fade,spin,mix,greyscale,e,escape,%,round,argb,asset-path,asset-url,image-path,image-url,video-path,video-url,audio-path,audio-url,javascript-path,javascript-url,stylesheet-path,stylesheet-url,font-path,font-url,asset-data-url

from less-rails.

adamburmister avatar adamburmister commented on August 29, 2024

I have drilled down to the Less-2.0.8 gem, into call.js to debug the try/catch there.

The resulting exception message is:
Error: This asset host cannot be computed without a request in scope. Remove the second argument to your asset_host Proc if you do not need the request.

from less-rails.

adamburmister avatar adamburmister commented on August 29, 2024

The cause of the problem was the setting of asset_host to a Proc within rails. The aim of this was to switch HTTP/HTTPS on the CDN we use. This may be a common issue for others.

The cause:

config.action_controller.asset_host = Proc.new do |source, request|
    method = request.ssl? ? "https" : "http"
    "#{method}://foobar.cloudfront.net"
end

The solution:
Remove the CDN switch, or guard against the missing request argument.

config.action_controller.asset_host = Proc.new do |source, request=nil|
    method = request != nil && request.ssl? ? "https" : "http"
    "#{method}://foobar.cloudfront.net"
end

from less-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.