Uglifier::Error:
See original GitHub issueUglifier::Error: from ****gems/uglifier-4.2.0/lib/uglifier.rb:291:in `parse_result’
To reproduce the error, just paste the code in your file and run Uglifier.new(harmony: true).compile(File.read("test.js"))
function f(){ return 1;};
var y = 42;
y = f();
const {p} = {p: 42};
But these code won’t raise this error:
function f(){ return 1;};
var y = 42;
y = f();
console.log(123)
const {p} = {p: 42};
function f(){ return 1;};
var y = 42;
const {p} = {p: 42};
y = f();
Any one knows the reason? I am using uglifier (4.2.0)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Uglifier::Error: - Solution: Switch to terser · Issue #185 - GitHub
Hi there, I am using: Ruby 3.1.2p20 Rails 7.0.3 Uglifier 4.2.0 In a previous version of Rails/Ruby (Rails 6 on Ruby 3.0), it...
Read more >Ruby on Rails Error: Uglifier::Error: Unexpected token
Whenever I run rake assets:precompile RAILS_ENV=production in my command line, I get this error which ...
Read more >Uglifier error during assets precompile - Discourse Meta
I'm seeing some errors trying to run rake assets:precompile on 2.1.0 (stable branch), which appears to be due to the use of const...
Read more >Rails 5 -> 6 Upgrade: ES6 Uglifier bug - Mintbit
However, it's not a big problem because Webpacker is now the default Rails 6 asset compiler. Webpacker removes the need for Uglifier so...
Read more >README — Documentation for uglifier (4.2.0) - RubyDoc.info
Uglifier ::Error: Unexpected token: punc ((). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue… I went back to Uglifier 4.1.0 in my Gemfile and it fixed it. Thanks for the tip
had the same same issue, had to reference your version and it worked for me too, thank you 👍