question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uglifier::Error:

See original GitHub issue

Uglifier::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:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
netelixcommented, May 28, 2021

Same issue… I went back to Uglifier 4.1.0 in my Gemfile and it fixed it. Thanks for the tip

gem 'uglifier', '= 4.1.0'
2reactions
longpaidcommented, Jul 10, 2020

Getting the same error. Had to fork the gem, re-package the harmony branch of uglify, then copy it into the fork. Seems to be working now - not sure what the cause is.

had the same same issue, had to reference your version and it worked for me too, thank you 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found