Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS processed by Uglifier 4.1.15 not working with phantomjs #150

Open
afdev82 opened this issue Aug 27, 2018 · 2 comments
Open

JS processed by Uglifier 4.1.15 not working with phantomjs #150

afdev82 opened this issue Aug 27, 2018 · 2 comments

Comments

@afdev82
Copy link

afdev82 commented Aug 27, 2018

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.

@DevinDow
Copy link

DevinDow commented Oct 13, 2018

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

@nekojanai
Copy link

nekojanai commented Apr 27, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants