-
Notifications
You must be signed in to change notification settings - Fork 82
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
Uglifier::Error: - Solution: Switch to terser #185
Comments
I am getting the same error during I am using:
|
As per #173 I am trying to downgrade Uglifier to 4.1.0 to see if it works |
When I downgrade to 4.1.0, I see this:
When I add --trace, I also see:
|
Not worked for me either. I got this:
I am using this syntax:
No clue what to do next! |
@rgaufman are you using |
Hi @rgaufman, replacing
worked for me. I have Need to confirm if this is a valid fix. |
I need the harmony: true option as I have a lot of ES6 syntax :( |
Oh wait, this did actually work, thank you! -- What a great workaround :D |
yeah this worked but did it compressed Javascripts with ES6 syntaxes properly? I am now validating this at my end as well |
As per Uglifier's Readme: UglifyJS only works with ES5. If you need to compress ES6, ruby-terser is a better option. It seems ES6 won't work well with Uglifier |
It seems to work, but I have coffee script and I think the asset pipeline is doing some heavy lifting? - terser looks interesting! - Have you switched to this from uglier? - it's strange I don't see it in the ruby docs, Uglifier appears to be the only option that doesn't have Java as a dependency from what I can tell! |
I am in process of testing terser. It seems both Uglifier and Terser works on execJS so switching is very easy |
I tried terser and it seems to have worked as a drop in replacement, I haven't seen any issues with the output yet. Thank you for the workarounds, that's super helpful! |
Worked for me too without any issues |
Thanks @puneetpandey fix my issue too. |
Uglifier(harmony: true) fails; :uglifier does not suit for ES6 See: lautis/uglifier#185
Uglifier(harmony: true) fails; :uglifier does not suit for ES6 See: lautis/uglifier#185
Uglifier(harmony: true) fails; :uglifier does not suit for ES6 See: lautis/uglifier#185
Uglifier(harmony: true) fails; :uglifier does not suit for ES6 See: lautis/uglifier#185
Uglifier(harmony: true) fails; :uglifier does not suit for ES6 See: lautis/uglifier#185
Failed to deploy on production with: Uglifier::Error: ../gems/uglifier-4.2.0/lib/uglifier.rb:291:in `parse_result' See lautis/uglifier/issues/185
Deploying fails on the `assets:precompile` step with: ``` Uglifier::Error: (Uglifier::Error) /uglifier.rb:291:in `parse_result' ``` Issue here: lautis/uglifier#185 There's a workaround suggested in the issue, but it's also suggested to move to the [Terser gem](https://github.com/ahorek/terser-ruby) as Uglifier's last update was more than 5 years ago, and Terser's is 3 weeks ago. This moves to the Terser gem.
Same problem here in Rails 7.1.
My config uses harmony too:
Interesting that @puneetpandey solution works with
Alternatively:
|
Use terser instead |
Hi there,
I am using:
In a previous version of Rails/Ruby (Rails 6 on Ruby 3.0), it was working correctly. However now I just see this:
When I run with trace, I see this:
The autoprefixer warning shows up when I disable uglifier too and doesn't seem to be related to this.
I can't for the life of me figure out what's wrong... any ideas how to troubleshoot this or what could be going wrong?
The text was updated successfully, but these errors were encountered: