Read more

Asset pipeline may break Javascript for IE (but only on production)

Tobias Kraze
September 26, 2012Software engineer at makandra GmbH

If some of your JavaScripts fail on Internet Explorer, but only in staging or production environments, chances are that JavaScript compression is the culprit.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

By default, Rails 3.2 compresses JavaScript with UglifyJS. I have seen a few cases where this actually breaks functioning JavaScript on IE (one example is the CKEditor Show archive.org snapshot ).

I fixed this by switching to Yahoo's YUI Compressor Show archive.org snapshot .

To do this, do the following:

  • replace the uglifier gem with the yui-compressor gem in your Gemfile

  • add this line to your application.rb:

    config.assets.js_compressor = :yui
    
Posted by Tobias Kraze to makandra dev (2012-09-26 18:36)