uglifier icon indicating copy to clipboard operation
uglifier copied to clipboard

JS processed by Uglifier 4.1.15 not working with phantomjs

Open afdev82 opened this issue 5 years ago • 2 comments

I had problems with a Phantomjs script that told me that jQuery and other global variables where not defined. Anyway in development mode everything was fine. In the end I discovered that the problem was that in production we use Uglifier to compress the Js and downgrading Uglifier to v4.1.13 solved the problem. The version 4.1.15 had the problem.

afdev82 avatar Aug 27 '18 10:08 afdev82

I have the same problem using Uglifier on Rails:

  • lots of JS did not work on production but did work locally on development
  • comment out config.assets.js_compressor = :uglifier in config/environments/production.rb and now all JS is working on production

My repo is https://github.com/DevinDow/ToDoRuby. My Gemfile.lock shows using uglifier 4.1.19

DevinDow avatar Oct 13 '18 15:10 DevinDow

I just encountered the same problem.

  • JS working fine in development but breaking randomly in production

My Gemfile.lock showed I was using uglifier 4.1.20

I am invoking uglifier as follows: config.assets.js_compressor = Uglifier.new(harmony: true)

I was having issues in particular with dsmorse/gridster.js added to the asset pipeline with its gem 'gridster.js-rails'

Also downgraded to uglifier 4.1.14 and now everything seems to be working as intended, will report back if that actually was the issue, but as the other issues suggested the seems to be some breaking changes in 4.1.15 and later versions.

-- EDIT --

So, as it turns out, uglifier deffo wasn't the issue, as it kept happening again albeit more sporadically, dunno if I'm just imagining something here though.

Turbolinks is my next best guess, as to why it happened in the first place, I entirely removed uglifier thinking it was this causing it, but it as I said before it kept happening after some time, which leads me to believe it's maybe a caching thing? - Well, as it's no longer an ugliefier issues, I will not comment further on this.

nekojanai avatar Apr 27 '19 22:04 nekojanai