Questions tagged [uglifier]

Uglifier change the source code of a program without changing their semantics, to prevent reverse engineering.

Uglifier or Minifier are tools which change the source code of a program in a way, that the semantic is unchanged.

Uglifier or minifier are normally used with scripting languages like JavaScript, where the source code must be provided, but the goal is:

  • to minimize the needed bandwidth for transmission
  • To obfuscate the source code so it is less likely to be reverse engineered
38 questions
57
votes
4 answers

ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true

I am facing this problem Uglifier::Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true). while deploying the project through capistrano on production. I followed this…
Ashish Jambhulkar
  • 1,374
  • 2
  • 14
  • 26
19
votes
1 answer

After Ruby 2.4 upgrade - error while trying to load the gem 'uglifier' (Bundler::GemRequireError)

I've just upgraded my App to use Ruby 2.4.0 without any errors during the bundling process. When I try to start my server, however, I get the following error: There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError) Gem…
Severin
  • 8,508
  • 14
  • 68
  • 117
5
votes
1 answer

Uglifier - NoMethodError: undefined method `start_with?' for nil:NilClass

I have been facing the NoMethodError: undefined method start_with?' for nil:NilClass error while precompiling assets in production. This seems to be an issue with uglifier and I am using the following gems: rails (5.2.2) uglifier…
dp7
  • 6,651
  • 1
  • 18
  • 37
4
votes
3 answers

How to recover original code file parsed by React build?

I'm working on React old projects and several of them have the native structure, like: ...{ key: "render", value: function () { return React.createElement( "div", { className: "WrapperExamQuery", id:…
bluesky777
  • 400
  • 6
  • 23
4
votes
1 answer

old-school JavaScript classes and advanced JS minification issue

I've got a fairly elaborate class which uses the old-style way of creating classes. Rather than using the class keywords, classes are defined using the function keyword. To create public properties, you assign this.publicProperty. My code works…
S. Imp
  • 2,833
  • 11
  • 24
3
votes
0 answers

Uglifier : Push fail on Heroku - Rails 5.2.3

I'm trying to deploy my app without database on Heroku and I got this error with Uglifier: rake aborted! Uglifier::Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony =>…
OBrooks
  • 343
  • 1
  • 3
  • 7
3
votes
2 answers

Angular 7 is not minifying html, js, css files

I have a problem with my project in Angular 7. The problem is after compilation I have no minified and uglified files in Chrome console. After running project in production environment I received this information in console: Time: 31790ms chunk…
whiteBear22
  • 377
  • 2
  • 8
  • 21
3
votes
2 answers

CKEditor doesn't work only in production env

I'm using the ckeditor ruby gem (v4.2.2) in my Rails app and it works fine in development but not in my production environment. It doesn't look like a problem with my Asset Pipeline because all other assets load without any issues. On the page,…
Sheharyar
  • 73,588
  • 21
  • 168
  • 215
2
votes
3 answers

Ruby on Rails Error: Uglifier::Error: Unexpected token: operator (<)

Whenever I run rake assets:precompile RAILS_ENV=production in my command line, I get this error which prevents me from precompiling my assets. Below is the complete error displayed in the command line: rake aborted! Uglifier::Error: Unexpected…
2
votes
2 answers

Rails 5 don't precompile JS files with ES6 code in production

I am deploying an app with some javascript that contain ES6 code. When I did run bundle exec rake assets:precompile RAILS_ENV=production, I got: ExecJS::RuntimeError: SyntaxError: Unexpected token: punc ()) This is because prueba.js has the…
Necrogoru
  • 108
  • 2
  • 9
2
votes
1 answer

uglifier gem load error / download node.js?

I am getting started with Ruby on Rails, and following the steps at InstallRails... I have created the sample_app on the desktop, and now I cannot create the server. My command $ rails server is answered with the following ...There was an error…
Philet
  • 73
  • 7
2
votes
2 answers

Enable Uglifier verbose logging in Sprockets-Rails

I have a Rails project where a newly added javascript file (plotly.min.js) is causing rake assets:precompile to hang indefinitely in production mode only. Since the problem is related to javascript compression, I would like to enable verbose logging…
ronan_mac
  • 428
  • 7
  • 16
1
vote
0 answers

Uglifier Error When Precompiling Assets with Filterrific Gem

Ruby version: 3.2.2 Rails version: 7.0.4.3 Filterrific gem version: 5.2.5 I am getting the following error on my server when I run rails:assets_precompile ** Execute assets:precompile rake aborted! Uglifier::Error: Unexpected token:…
Mark Fraser
  • 3,160
  • 2
  • 29
  • 48
1
vote
2 answers

Are .min.js / .min.css files loaded / parsed differently?

I've minified all of my Js and Css scripts and stylesheets, respectively, but deployed them on my site as .js and .css files, respectively. A colleague now told me that it's better to store their names using the .min prefix, as this will be…
DevelJoe
  • 856
  • 1
  • 10
  • 24
1
vote
1 answer

JS Compression issues - callback called twice when using uglifier

Got the following code import Rails from 'rails-ujs' import _ from 'underscore' export default class Ajax { static post(url, payload, success, error = () => {}, context = {}) { Rails.ajax({ url: url, data: payload, type:…
Chen Kinnrot
  • 20,609
  • 17
  • 79
  • 141
1
2 3