Bootstrap 3 JS

37 views
Skip to first unread message

Miles Matthias

unread,
Feb 28, 2014, 1:03:41 PM2/28/14
to ugli...@googlegroups.com
Hey all,

I wanted to share a recent bug / fix we encountered yesterday. There was nothing anywhere using Google to try and research the bug, but updating the uglifier gem in our rails app fixed it.

Including Bootstrap.js from Bootstrap 3 resulted in the following error when precompiling assets:

% RAILS_ENV=production rake assets:precompile
/Users/mmoen/.rbenv/versions/1.9.3-p484/bin/ruby bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
TypeError: Cannot call method 'active' of undefined
  (in /Users/mmoen/code/dojo4/gnerdl/app/assets/javascripts/application.js)
/Users/mmoen/code/dojo4/gnerdl/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:34:in `rescue in block in eval'
/Users/mmoen/code/dojo4/gnerdl/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:28:in `block in eval'
/Users/mmoen/code/dojo4/gnerdl/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:80:in `block in lock'
/Users/mmoen/code/dojo4/gnerdl/vendor/bundle/ruby/1.9.1/gems/therubyracer-0.10.1/lib/v8/c/locker.rb:13:in `Locker'

When we substituted bootstrap3 with bootstrap 2.3.2's js, compilation & minification worked.

We upgraded uglifier from 1.2.6 to 2.4.0 and minifying with bootstrap 3 worked.

I was wondering if anyone had any insight into this, knows what fix in uglifier fixed this, or had seen this before? I'd like to know more about why it was blowing up.

Thanks!

-- Miles

Mihai Călin Bazon

unread,
Feb 28, 2014, 1:09:40 PM2/28/14
to ugli...@googlegroups.com
For version 2 UglifyJS has been completely rewritten, so it might be hard to figure out exactly what was the "fix".  Version 1.x is no longer maintained, so you should remain on v2 — glad to hear the error no longer occurs.  Please report any issues you find with v2 (note that the current version is 2.4.12).

Best,
-Mihai


--
You received this message because you are subscribed to the Google Groups "UglifyJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uglifyjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Mihai Bazon,
http://lisperator.net/
Reply all
Reply to author
Forward
0 new messages